FileEntry fileEntry = fileListingService.getRoot(); for ( String destinationPathSegment : destinationPathSegments ) fileListingService.getChildren( fileEntry, true, null );
fileEntries = fileListingService.getChildren( sourceFileEntry, true, null );
Public FileEntry getEntry(String remotePath, IDevice device){ FileListingService listingService; listingService = device.getFileListingService(); FileEntry entry = listingService.getRoot(); String [ ] segments = remotPath.split("/"); for(String segment : segments){ listingSevice.getChildren(entry, false ,null); entry = entry.findChild(sement): if(entry==null){ // throw new Exception(); } } return entry; }
@Override public FileListingService getFileListingService() { return new FileListingService(this); }
doLs(entry); return entry.getCachedChildren();
private void doLs(FileEntry entry) { try { doLsAndThrow(entry); } catch (Exception e) { // do nothing } }
/** * compute the recursive file size of all the files in the list. Folder * have a weight of 1. * @param entries * @param fls * @return */ private int getTotalRemoteFileSize(FileEntry[] entries, FileListingService fls) { int count = 0; for (FileEntry e : entries) { int type = e.getType(); if (type == FileListingService.TYPE_DIRECTORY) { // get the children FileEntry[] children = fls.getChildren(e, false, null); count += getTotalRemoteFileSize(children, fls) + 1; } else if (type == FileListingService.TYPE_FILE) { count += e.getSizeValue(); } } return count; }
public FileListingService getFileListingService() { return new FileListingService(this); }
doLs(entry); return entry.getCachedChildren();
/** * Returns the children of a {@link FileEntry}. * <p> * This method is the explicit synchronous version of * {@link #getChildren(FileEntry, boolean, IListingReceiver)}. It is roughly equivalent to * calling * getChildren(FileEntry, false, null) * * @param entry The parent entry. * @return The list of children * @throws TimeoutException in case of timeout on the connection when sending the command. * @throws AdbCommandRejectedException if adb rejects the command. * @throws ShellCommandUnresponsiveException in case the shell command doesn't send any output * for a period longer than <var>maxTimeToOutputResponse</var>. * @throws IOException in case of I/O error on the connection. */ public FileEntry[] getChildrenSync(final FileEntry entry) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException { doLsAndThrow(entry); return entry.getCachedChildren(); }
private boolean resourceNeedsSending(WrappedDevice device) { FileListingService listingService = device.getFileListingService(); FileListingService.FileEntry result = listingService.getRoot(); if(result == null) { listingService.getChildren(result, true, null); result = result.findChild(segment); if (result == null) {
/** * compute the recursive file size of all the files in the list. Folder * have a weight of 1. * @param entries * @param fls * @return */ private int getTotalRemoteFileSize(FileEntry[] entries, FileListingService fls) { int count = 0; for (FileEntry e : entries) { int type = e.getType(); if (type == FileListingService.TYPE_DIRECTORY) { // get the children FileEntry[] children = fls.getChildren(e, false, null); count += getTotalRemoteFileSize(children, fls) + 1; } else if (type == FileListingService.TYPE_FILE) { count += e.getSizeValue(); } } return count; }
FileListingService fls = new FileListingService(mDevice);
FileEntry[] children = fileListingService.getChildren(e, true, null); doPull(children, dest, fileListingService, monitor); monitor.advance(1);
FileListingService fls = new FileListingService(mDevice);
FileEntry[] children = fileListingService.getChildren(e, true, null); doPull(children, dest, fileListingService, monitor); monitor.advance(1);