public class SrmliteCopier extends FileCopierBase
LocalExec to copy file/directory
between local host and a remote host. To copy files between remote machines,
uses SshExec, connects to source machine using ssh and execute
srmlite command to copy to remote machine
scp is used as the default protocol passed to srmlite. It can be overriden by setting the srmProtocol variable
Copy operation will overwrite existing files by default. Retry feature of srmlite is not currently supported.
On the source machine, if srmlite is not on standard path and if the variable protocolPathSrc is not set, the class attempts to search in the most common locations - user's home directory, /usr/bin, /bin, and /usr/local/bin
FileCopierBase.CopyResultcmdLineOptions, forcedCleanup, protocolPathDest, protocolPathSrc, timeout| Constructor and Description |
|---|
SrmliteCopier() |
| Modifier and Type | Method and Description |
|---|---|
void |
build_xml_ForLocalSource(java.lang.String fileName,
java.lang.String[] fileList,
java.lang.String destFile) |
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 |
fileListCopyFrom(java.lang.String cmdWithPath,
java.lang.String HostStr) |
protected int |
getDefaultPort()
default port for the file transfer protocol.
|
java.lang.String |
getSrmProtocol() |
void |
setSrmProtocol(java.lang.String srmProtocol) |
copy, copyLocal, copyLocalOnRemoteMachine, getCmdLineOptions, getCmdWithDefaultPath, getProtocolPathDest, getProtocolPathSrc, getTimeout, isForcedCleanup, setCleanup, setCmdLineOptions, setProtocolPathDest, setProtocolPathSrc, setTimeoutpublic SrmliteCopier()
protected FileCopierBase.CopyResult copyFrom(ConnectionDetails srcDetails, java.lang.String srcFile, java.lang.String destFile, boolean recursive) throws SshException
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 recursivelySshExceptionprotected FileCopierBase.CopyResult copyTo(java.lang.String srcFile, ConnectionDetails destDetails, java.lang.String destFile, boolean recursive) throws SshException
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 recursivelySshExceptionpublic void build_xml_ForLocalSource(java.lang.String fileName, java.lang.String[] fileList, java.lang.String destFile) throws java.io.IOException
java.io.IOExceptionprotected 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 recursivelyExecExceptionprotected int getDefaultPort()
FileCopierBasegetDefaultPort in class FileCopierBasepublic java.lang.String getSrmProtocol()
public void setSrmProtocol(java.lang.String srmProtocol)
protected int fileListCopyFrom(java.lang.String cmdWithPath, java.lang.String HostStr) throws java.lang.Exception
java.lang.Exception