mirror of
https://github.com/revanced/jadb.git
synced 2025-02-11 09:36:48 +01:00
Refactor: Renaming to RemoteFile to better match the java api
This commit is contained in:
parent
272a29a750
commit
d456c1d79a
@ -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());
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user