/** * Push a single file. * @param local the local filepath. * @param remote The remote filepath. * @param monitor The progress monitor. Cannot be null. * * @throws SyncException if file could not be pushed * @throws IOException in case of I/O error on the connection. * @throws TimeoutException in case of a timeout reading responses from the device. */ public void pushFile(String local, String remote, ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { File f = new File(local); if (!f.exists()) { throw new SyncException(SyncError.NO_LOCAL_FILE); } if (f.isDirectory()) { throw new SyncException(SyncError.LOCAL_IS_DIRECTORY); } monitor.start((int)f.length()); doPushFile(local, remote, monitor); monitor.stop(); }
/** * Push a single file. * @param local the local filepath. * @param remote The remote filepath. * @param monitor The progress monitor. Cannot be null. * * @throws SyncException if file could not be pushed * @throws IOException in case of I/O error on the connection. * @throws TimeoutException in case of a timeout reading responses from the device. */ public void pushFile(String local, String remote, ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { File f = new File(local); if (!f.exists()) { throw new SyncException(SyncError.NO_LOCAL_FILE); } if (f.isDirectory()) { throw new SyncException(SyncError.LOCAL_IS_DIRECTORY); } monitor.start((int)f.length()); doPushFile(local, remote, monitor); monitor.stop(); }
/** * Push a single file. * @param local the local filepath. * @param remote The remote filepath. * @param monitor The progress monitor. Cannot be null. * * @throws SyncException if file could not be pushed * @throws IOException in case of I/O error on the connection. * @throws TimeoutException in case of a timeout reading responses from the device. */ public void pushFile(String local, String remote, ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { File f = new File(local); if (f.exists() == false) { throw new SyncException(SyncError.NO_LOCAL_FILE); } if (f.isDirectory()) { throw new SyncException(SyncError.LOCAL_IS_DIRECTORY); } monitor.start((int)f.length()); doPushFile(local, remote, monitor); monitor.stop(); }
doPushFile(f.getAbsolutePath(), remoteFile, monitor);
doPushFile(f.getAbsolutePath(), remoteFile, monitor);