Refactor: Renaming to RemoteFile to better match the java api

This commit is contained in:
Samuel Carlsson 2014-03-19 16:56:38 +01:00
parent 272a29a750
commit d456c1d79a
3 changed files with 7 additions and 9 deletions

View File

@ -69,7 +69,7 @@ public class AndroidDevice {
SyncTransport sync = transport.startSync();
sync.send("LIST", remotePath);
for (DirectoryEntry dent = sync.readDirectoryEntry(); dent != DirectoryEntry.DONE; dent = sync.readDirectoryEntry())
for (RemoteFile dent = sync.readDirectoryEntry(); dent != RemoteFile.DONE; dent = sync.readDirectoryEntry())
{
System.out.println(dent.getName());
}

View File

@ -1,15 +1,13 @@
package se.vidstige.jadb;
import java.io.File;
/**
* Created by vidstige on 2014-03-19.
*/
class DirectoryEntry {
public static final DirectoryEntry DONE = new DirectoryEntry("DONE", null);
class RemoteFile {
public static final RemoteFile DONE = new RemoteFile("DONE", null);
private String name;
public DirectoryEntry(String id, String name) {
public RemoteFile(String id, String name) {
this.name = name;
}

View File

@ -33,7 +33,7 @@ class SyncTransport {
return new String(buffer, Charset.forName("utf-8"));
}
public DirectoryEntry readDirectoryEntry() throws IOException {
public RemoteFile readDirectoryEntry() throws IOException {
String id = readString(4);
int mode = readInt();
int size = readInt();
@ -41,7 +41,7 @@ class SyncTransport {
int nameLenght = readInt();
String name = readString(nameLenght);
if ("DENT".equals(id) == false) return DirectoryEntry.DONE;
return new DirectoryEntry(id, name);
if ("DENT".equals(id) == false) return RemoteFile.DONE;
return new RemoteFile(id, name);
}
}