if (result.getSizeValue() != getLocalSourceFile().length()) { return true; // Send the file if the sizes don't match
/** * 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; }
/** * Pulls a single file. * @param remote the remote file * @param localFilename The local destination. * @param monitor The progress monitor. Cannot be null. * * @throws IOException in case of an IO exception. * @throws TimeoutException in case of a timeout reading responses from the device. * @throws SyncException in case of a sync exception. * * @see FileListingService.FileEntry * @see #getNullProgressMonitor() */ public void pullFile(FileEntry remote, String localFilename, ISyncProgressMonitor monitor) throws IOException, SyncException, TimeoutException { int total = remote.getSizeValue(); monitor.start(total); doPullFile(remote.getFullPath(), localFilename, monitor); monitor.stop(); }
/** * 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; }
/** * Pulls a single file. * @param remote the remote file * @param localFilename The local destination. * @param monitor The progress monitor. Cannot be null. * * @throws IOException in case of an IO exception. * @throws TimeoutException in case of a timeout reading responses from the device. * @throws SyncException in case of a sync exception. * * @see FileListingService.FileEntry * @see #getNullProgressMonitor() */ public void pullFile(FileEntry remote, String localFilename, ISyncProgressMonitor monitor) throws IOException, SyncException, TimeoutException { int total = remote.getSizeValue(); monitor.start(total); doPullFile(remote.getFullPath(), localFilename, monitor); monitor.stop(); }