private void setAttributes(LocalSourceFile local, String remotePath) throws IOException { if (getPreserveAttributes()) { engine.setAttributes(remotePath, getAttributes(local)); } }
@SuppressWarnings("PMD.MissingBreakInSwitch") private void download(final TransferListener listener, final RemoteResourceInfo remote, final LocalDestFile local) throws IOException { final LocalDestFile adjustedFile; switch (remote.getAttributes().getType()) { case DIRECTORY: adjustedFile = downloadDir(listener.directory(remote.getName()), remote, local); break; case UNKNOWN: log.warn("Server did not supply information about the type of file at `{}` " + "-- assuming it is a regular file!", remote.getPath()); case REGULAR: adjustedFile = downloadFile(listener.file(remote.getName(), remote.getAttributes().getSize()), remote, local); break; default: throw new IOException(remote + " is not a regular file or directory"); } if (getPreserveAttributes()) copyAttributes(remote, adjustedFile); }
private void setAttributes(LocalSourceFile local, String remotePath) throws IOException { if (getPreserveAttributes()) { engine.setAttributes(remotePath, getAttributes(local)); } }
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)); }
private void download(final TransferListener listener, final RemoteResourceInfo remote, final LocalDestFile local) throws IOException { final LocalDestFile adjustedFile; switch (remote.getAttributes().getType()) { case DIRECTORY: adjustedFile = downloadDir(listener.directory(remote.getName()), remote, local); break; case UNKNOWN: log.warn("Server did not supply information about the type of file at `{}` " + "-- assuming it is a regular file!", remote.getPath()); case REGULAR: adjustedFile = downloadFile(listener.file(remote.getName(), remote.getAttributes().getSize()), remote, local); break; default: throw new IOException(remote + " is not a regular file or directory"); } if (getPreserveAttributes()) copyAttributes(remote, adjustedFile); }
@SuppressWarnings("PMD.MissingBreakInSwitch") private void download(final TransferListener listener, final RemoteResourceInfo remote, final LocalDestFile local) throws IOException { final LocalDestFile adjustedFile; switch (remote.getAttributes().getType()) { case DIRECTORY: adjustedFile = downloadDir(listener.directory(remote.getName()), remote, local); break; case UNKNOWN: log.warn("Server did not supply information about the type of file at `{}` " + "-- assuming it is a regular file!", remote.getPath()); case REGULAR: adjustedFile = downloadFile(listener.file(remote.getName(), remote.getAttributes().getSize()), remote, local); break; default: throw new IOException(remote + " is not a regular file or directory"); } if (getPreserveAttributes()) copyAttributes(remote, adjustedFile); }