/** * 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(); }