[ https://issues.apache.org/jira/browse/SSHD-1333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
dgü updated SSHD-1333: ---------------------- Description: Hello! remote-to-remote file transfer is available in SCP protocol. If I'm not wrong, it is not available in SFTP protocol. I'm trying to use the following code to handle remote-to-remote file transfer. {code:java} public class SSHDFileSystemProvider extends SftpFileSystemProvider { private final static String URI_SCHEME = "ssh"; private final static boolean PRESERVE_ATTRIBUTES = true; @Override public String getScheme() { return URI_SCHEME; } @Override public void copy(Path sourcePath, Path targetPath, CopyOption... options) throws IOException { ClientSession sourceClientSession = ((SftpFileSystem) (sourcePath.getFileSystem())).getClientSession(); ClientSession targetClientSession = ((SftpFileSystem) (targetPath.getFileSystem())).getClientSession(); ScpRemote2RemoteTransferHelper helper = new ScpRemote2RemoteTransferHelper(sourceClientSession, targetClientSession); helper.transferFile(sourcePath.toString(), targetPath.toString(), PRESERVE_ATTRIBUTES); } } {code} _ScpRemote2RemoteTransferHelper.transferFile(String,String,boolean)_ accepts preserve attributes only as the copy option. My request: - is it possible to add java.nio.file.CopyOption to SCP transfer methods? Thanks in advance? was: Hello! remote-to-remote file transfer is available in SCP protocol. If I'm not wrong, it is not available in SFTP protocol. I'm trying to use the following code to handle remote-to-remote file transfer. {code:java} public class SSHDFileSystemProvider extends SftpFileSystemProvider { private final static String URI_SCHEME = "ssh"; private final static boolean PRESERVE_ATTRIBUTES = true; @Override public String getScheme() { return URI_SCHEME; } @Override public void copy(Path sourcePath, Path targetPath, CopyOption... options) throws IOException { ClientSession sourceClientSession = ((SftpFileSystem) (sourcePath.getFileSystem())).getClientSession(); ClientSession targetClientSession = ((SftpFileSystem) (targetPath.getFileSystem())).getClientSession(); ScpRemote2RemoteTransferHelper helper = new ScpRemote2RemoteTransferHelper(sourceClientSession, targetClientSession); helper.transferFile(sourcePath.toString(), targetPath.toString(), PRESERVE_ATTRIBUTES); } } {code} _ScpRemote2RemoteTransferHelper.transferFile(String,String,boolean)_ accepts preserve attributes only as the copy option. My questions : - is it possible to add java.nio.file.CopyOption to SCP transfer methods ? - are the attributes preserved by _ScpRemote2RemoteTransferHelper.transferFile(String,String,boolean)_ and _SftpFileSystemProvider with StandardCopyOption.COPY_ATTRIBUTES_ the same attributes ? Thanks in advance? > Adding java.nio.file.CopyOption to SCP transfer methods > ------------------------------------------------------- > > Key: SSHD-1333 > URL: https://issues.apache.org/jira/browse/SSHD-1333 > Project: MINA SSHD > Issue Type: New Feature > Reporter: dgü > Priority: Major > > Hello! > remote-to-remote file transfer is available in SCP protocol. If I'm not > wrong, it is not available in SFTP protocol. > I'm trying to use the following code to handle remote-to-remote file transfer. > {code:java} > public class SSHDFileSystemProvider extends SftpFileSystemProvider { > private final static String URI_SCHEME = "ssh"; > > private final static boolean PRESERVE_ATTRIBUTES = true; > @Override > public String getScheme() { > return URI_SCHEME; > } > @Override > public void copy(Path sourcePath, Path targetPath, CopyOption... options) > throws IOException { > ClientSession sourceClientSession = ((SftpFileSystem) > (sourcePath.getFileSystem())).getClientSession(); > ClientSession targetClientSession = ((SftpFileSystem) > (targetPath.getFileSystem())).getClientSession(); > ScpRemote2RemoteTransferHelper helper = new > ScpRemote2RemoteTransferHelper(sourceClientSession, targetClientSession); > helper.transferFile(sourcePath.toString(), targetPath.toString(), > PRESERVE_ATTRIBUTES); > } > } > {code} > _ScpRemote2RemoteTransferHelper.transferFile(String,String,boolean)_ accepts > preserve attributes only as the copy option. > My request: > - is it possible to add java.nio.file.CopyOption to SCP transfer methods? > Thanks in advance? -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org