public class SftpCopier extends FileCopierBase
FileCopierBase.CopyResultcmdLineOptions, forcedCleanup, protocolPathDest, protocolPathSrc, timeout| Constructor and Description |
|---|
SftpCopier() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
buildSftpCommand(ConnectionDetails srcDetails,
java.lang.String srcFile,
ConnectionDetails destDetails,
java.lang.String destFile,
boolean recursive,
SftpExec sshObject,
java.lang.String cmdFile)
Anand: Create a batch file for a file or directory and give that to sftp
to perform copy This function creates batch file, and builds sftp copy
command and returns it to calling function.
|
java.lang.String |
buildSftpWildcardBatch(ConnectionDetails srcDetails,
java.lang.String srcFile,
ConnectionDetails destDetails,
java.lang.String destFile,
boolean recursive,
SftpExec sshObject,
java.lang.String cmdFile)
Anand: Create a command for remote to remote SFTP copy.
|
protected FileCopierBase.CopyResult |
copyFrom(ConnectionDetails srcDetails,
java.lang.String srcFile,
java.lang.String destFile,
boolean recursive)
Copies file from a remote host to local machine
|
protected FileCopierBase.CopyResult |
copyRemote(ConnectionDetails srcDetails,
java.lang.String srcFile,
ConnectionDetails destDetails,
java.lang.String destFile,
boolean recursive)
Copies files between two remote machines.
|
protected FileCopierBase.CopyResult |
copyTo(java.lang.String srcFile,
ConnectionDetails destDetails,
java.lang.String destFile,
boolean recursive)
Copies files from local machine to a remote host
|
protected int |
getDefaultPort()
default port for the file transfer protocol.
|
copy, copyLocal, copyLocalOnRemoteMachine, getCmdLineOptions, getCmdWithDefaultPath, getProtocolPathDest, getProtocolPathSrc, getTimeout, isForcedCleanup, setCleanup, setCmdLineOptions, setProtocolPathDest, setProtocolPathSrc, setTimeoutpublic SftpCopier()
protected FileCopierBase.CopyResult copyFrom(ConnectionDetails srcDetails, java.lang.String srcFile, java.lang.String destFile, boolean recursive) throws ExecException
FileCopierBasecopyFrom in class FileCopierBasesrcDetails - - object containing the source machine connection detailssrcFile - - source file to be copieddestFile - - local path into which source should be copiedrecursive - - flag to indicate if directories should be copied recursivelyExecExceptionprotected FileCopierBase.CopyResult copyTo(java.lang.String srcFile, ConnectionDetails destDetails, java.lang.String destFile, boolean recursive) throws ExecException
FileCopierBasecopyTo in class FileCopierBasesrcFile - - local source file to be copieddestDetails - - object containing the destination machine connection detailsdestFile - - path into which source should be copiedrecursive - - flag to indicate if directories should be copied recursivelyExecExceptionprotected FileCopierBase.CopyResult copyRemote(ConnectionDetails srcDetails, java.lang.String srcFile, ConnectionDetails destDetails, java.lang.String destFile, boolean recursive) throws ExecException
FileCopierBasecopyRemote in class FileCopierBasesrcDetails - - object containing the source machine connection detailssrcFile - - source file to be copieddestDetails - - object containing the destination machine connection detailsdestFile - - path into which source should be copiedrecursive - - flag to indicate if directory should be copied recursivelyExecExceptionpublic java.lang.String buildSftpWildcardBatch(ConnectionDetails srcDetails, java.lang.String srcFile, ConnectionDetails destDetails, java.lang.String destFile, boolean recursive, SftpExec sshObject, java.lang.String cmdFile) throws java.lang.Exception
srcDetails - - Source connection detailssrcFile - - Source file namedestDetails - - Destination connection detailsdestFile - - destination file namerecursive - - true/false for directorysshObject - - used to connect to remote machine to get file list matching
wildcardcmdFile - - batch file namejava.lang.Exceptionpublic java.lang.String buildSftpCommand(ConnectionDetails srcDetails, java.lang.String srcFile, ConnectionDetails destDetails, java.lang.String destFile, boolean recursive, SftpExec sshObject, java.lang.String cmdFile) throws java.lang.Exception
srcDetails - - Source connection detailssrcFile - - Source file namedestDetails - - Destination connection detailsdestFile - - destination file namerecursive - - true/false for directorysshObject - - used to connect to remote machine to get file list matching
wildcardcmdFile - - batch file namejava.lang.Exceptionprotected int getDefaultPort()
FileCopierBasegetDefaultPort in class FileCopierBase