mirror of
https://github.com/revanced/jadb.git
synced 2025-02-14 11:06: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();
|
SyncTransport sync = transport.startSync();
|
||||||
sync.send("LIST", remotePath);
|
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());
|
System.out.println(dent.getName());
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
package se.vidstige.jadb;
|
package se.vidstige.jadb;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by vidstige on 2014-03-19.
|
* Created by vidstige on 2014-03-19.
|
||||||
*/
|
*/
|
||||||
class DirectoryEntry {
|
class RemoteFile {
|
||||||
public static final DirectoryEntry DONE = new DirectoryEntry("DONE", null);
|
public static final RemoteFile DONE = new RemoteFile("DONE", null);
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public DirectoryEntry(String id, String name) {
|
public RemoteFile(String id, String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
@ -33,7 +33,7 @@ class SyncTransport {
|
|||||||
return new String(buffer, Charset.forName("utf-8"));
|
return new String(buffer, Charset.forName("utf-8"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DirectoryEntry readDirectoryEntry() throws IOException {
|
public RemoteFile readDirectoryEntry() throws IOException {
|
||||||
String id = readString(4);
|
String id = readString(4);
|
||||||
int mode = readInt();
|
int mode = readInt();
|
||||||
int size = readInt();
|
int size = readInt();
|
||||||
@ -41,7 +41,7 @@ class SyncTransport {
|
|||||||
int nameLenght = readInt();
|
int nameLenght = readInt();
|
||||||
String name = readString(nameLenght);
|
String name = readString(nameLenght);
|
||||||
|
|
||||||
if ("DENT".equals(id) == false) return DirectoryEntry.DONE;
|
if ("DENT".equals(id) == false) return RemoteFile.DONE;
|
||||||
return new DirectoryEntry(id, name);
|
return new RemoteFile(id, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user