public class BbcpCopier extends FileCopierBase
SshExec
methods to execute command.
Copy operation would fail if file with the same name already exists. Command line options can be set to override the default behavior
The path of bbcp executable on the remote machine should be set in the class variable 'protocolPathDest', if bbcp is installed on a non standard path. On the local machine or remote source machine, if the variable protocolPathSrc is not set, attempt is made to search the most common locations user's home directory, /usr/bin, /bin, and /usr/local/bin. If the executable is not found in the above paths, an error is reported
FileCopierBase.CopyResult
cmdLineOptions, forcedCleanup, protocolPathDest, protocolPathSrc, timeout
Constructor and Description |
---|
BbcpCopier() |
Modifier and Type | Method and Description |
---|---|
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, setTimeout
public BbcpCopier()
protected FileCopierBase.CopyResult copyFrom(ConnectionDetails srcDetails, java.lang.String srcFile, java.lang.String destFile, boolean recursive) throws SshException
FileCopierBase
copyFrom
in class FileCopierBase
srcDetails
- - 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 recursivelySshException
protected FileCopierBase.CopyResult copyTo(java.lang.String srcFile, ConnectionDetails destDetails, java.lang.String destFile, boolean recursive) throws SshException
FileCopierBase
copyTo
in class FileCopierBase
srcFile
- - 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 recursivelySshException
protected FileCopierBase.CopyResult copyRemote(ConnectionDetails srcDetails, java.lang.String srcFile, ConnectionDetails destDetails, java.lang.String destFile, boolean recursive) throws ExecException
FileCopierBase
copyRemote
in class FileCopierBase
srcDetails
- - 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 recursivelyExecException
protected int getDefaultPort()
FileCopierBase
getDefaultPort
in class FileCopierBase