/** * 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(); }
/** * 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(); }
/** * Pulls a single file. * <p/>The size of the file being pulled is unknown and the * {@link ISyncProgressMonitor} will not properly show the progress * @param remoteFilepath the full path to 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 #getNullProgressMonitor() */ public void pullFile(String remoteFilepath, String localFilename, ISyncProgressMonitor monitor) throws TimeoutException, IOException, SyncException { Integer mode = readMode(remoteFilepath); if (mode == null) { // attempts to download anyway } else if (mode == 0) { throw new SyncException(SyncError.NO_REMOTE_OBJECT); } monitor.start(0); doPullFile(remoteFilepath, localFilename, monitor); monitor.stop(); }
/** * Pulls a single file. * <p/>Because this method just deals with a String for the remote file instead of a * {@link FileEntry}, the size of the file being pulled is unknown and the * {@link ISyncProgressMonitor} will not properly show the progress * @param remoteFilepath the full path to 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 #getNullProgressMonitor() */ public void pullFile(String remoteFilepath, String localFilename, ISyncProgressMonitor monitor) throws TimeoutException, IOException, SyncException { Integer mode = readMode(remoteFilepath); if (mode == null) { // attempts to download anyway } else if (mode == 0) { throw new SyncException(SyncError.NO_REMOTE_OBJECT); } monitor.start(0); //TODO: use the {@link FileListingService} to get the file size. doPullFile(remoteFilepath, localFilename, monitor); monitor.stop(); }
/** * Pulls a single file. * <p>Because this method just deals with a String for the remote file instead of a * {@link FileEntry}, the size of the file being pulled is unknown and the * {@link ISyncProgressMonitor} will not properly show the progress * @param remoteFilepath the full path to 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 #getNullProgressMonitor() */ public void pullFile(String remoteFilepath, String localFilename, ISyncProgressMonitor monitor) throws TimeoutException, IOException, SyncException { FileStat fileStat = statFile(remoteFilepath); if (fileStat == null) { // attempts to download anyway } else if (fileStat.getMode() == 0) { throw new SyncException(SyncError.NO_REMOTE_OBJECT); } monitor.start(0); //TODO: use the {@link FileListingService} to get the file size. doPullFile(remoteFilepath, localFilename, monitor); monitor.stop(); }
monitor.startSubTask(e.getFullPath()); String dest = localPath + File.separator + e.getName(); doPullFile(e.getFullPath(), dest, monitor);
monitor.startSubTask(e.getFullPath()); String dest = localPath + File.separator + e.getName(); doPullFile(e.getFullPath(), dest, monitor);