0
我想在Android上从sdcard中提取一系列文件。 我的问题是如何获得sdcard中的某些东西的FileEntry对象?使用Java,如何通过编程方式获得sdcard over adb中的ddmlib FileEntry对象?
public void pull(FileEntry[] entries, String localPath, ISyncProgressMonitor monitor)
我想在Android上从sdcard中提取一系列文件。 我的问题是如何获得sdcard中的某些东西的FileEntry对象?使用Java,如何通过编程方式获得sdcard over adb中的ddmlib FileEntry对象?
public void pull(FileEntry[] entries, String localPath, ISyncProgressMonitor monitor)
public FileEntry getEntry(String remotePath, IDevice device) {
FileListingService listingService = device.getFileListingService();
FileEntry entry = listingService.getRoot();
String[] segments = remotePath.split("/");
for(String segment : segments) {
listingService.getChildren(entry, false, null);
entry = entry.findChild(segment):
if(entry == null){
// throw new Exception();
}
}
return entry;
}