private void upload(final TransferListener listener, final LocalSourceFile local, final String remote) throws IOException { final String adjustedPath; if (local.isDirectory()) { adjustedPath = uploadDir(listener.directory(local.getName()), local, remote); } else if (local.isFile()) { adjustedPath = uploadFile(listener.file(local.getName(), local.getLength()), local, remote); } else { throw new IOException(local + " is not a file or directory"); } setAttributes(local, adjustedPath); }
private void upload(final TransferListener listener) throws IOException { if (source.isDirectory()) { makeDirIfNotExists(remote); // Ensure that the directory exists uploadDir(listener.directory(source.getName()), source, remote); setAttributes(source, remote); } else if (source.isFile() && isDirectory(remote)) { String adjustedRemote = engine.getPathHelper().adjustForParent(this.remote, source.getName()); uploadFile(listener.file(source.getName(), source.getLength()), source, adjustedRemote); setAttributes(source, adjustedRemote); } else if (source.isFile()) { uploadFile(listener.file(source.getName(), source.getLength()), source, remote); setAttributes(source, remote); } else { throw new IOException(source + " is not a file or directory"); } }
private void upload(final TransferListener listener, final LocalSourceFile local, final String remote) throws IOException { final String adjustedPath; if (local.isDirectory()) { adjustedPath = uploadDir(listener.directory(local.getName()), local, remote); } else if (local.isFile()) { adjustedPath = uploadFile(listener.file(local.getName(), local.getLength()), local, remote); } else { throw new IOException(local + " is not a file or directory"); } setAttributes(local, adjustedPath); }
private void upload(final TransferListener listener) throws IOException { if (source.isDirectory()) { makeDirIfNotExists(remote); // Ensure that the directory exists uploadDir(listener.directory(source.getName()), source, remote); setAttributes(source, remote); } else if (source.isFile() && isDirectory(remote)) { String adjustedRemote = engine.getPathHelper().adjustForParent(this.remote, source.getName()); uploadFile(listener.file(source.getName(), source.getLength()), source, adjustedRemote); setAttributes(source, adjustedRemote); } else if (source.isFile()) { uploadFile(listener.file(source.getName(), source.getLength()), source, remote); setAttributes(source, remote); } else { throw new IOException(source + " is not a file or directory"); } }
private void upload(final TransferListener listener, final LocalSourceFile local, final String remote) throws IOException { final String adjustedPath; if (local.isDirectory()) { adjustedPath = uploadDir(listener.directory(local.getName()), local, remote); } else if (local.isFile()) { adjustedPath = uploadFile(listener.file(local.getName(), local.getLength()), local, remote); } else throw new IOException(local + " is not a file or directory"); if (getPreserveAttributes()) engine.setAttributes(adjustedPath, getAttributes(local)); }