|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindbright.sshcommon.SSHSCP1
public final class SSHSCP1
Copy files using the scp1 protocol. The scp1 protocol is not officially documented but it is very similar to the rcp protocol. The protocol was first introduce together with version 1 of ssh. Hence the '1' in the name which is very confusing because nothing prevents this protocol to run on top of SSHv2. In fact the protocol is completely transport neutral and instead relies on the presence of a compatible scp command on the server.
Field Summary | |
---|---|
static int |
DEFAULT_COPY_BUFFER_SZ
SIze of chunks used when copying files |
Constructor Summary | |
---|---|
SSHSCP1(java.io.File cwd,
SSHConsoleRemote remote,
boolean verbose)
Create a new instance ready to copy files and which uses the provided SSHConsoleRemote instance. |
Method Summary | |
---|---|
void |
abort()
Abort all operations |
void |
copyToLocal(java.lang.String localFile,
java.lang.String[] remoteFiles,
boolean recursive)
Copy remote files to the local system. |
void |
copyToLocal(java.lang.String localFile,
java.lang.String remoteFile,
boolean recursive)
Copy a single remote file or directory to the local system |
void |
copyToRemote(java.lang.String[] localFiles,
java.lang.String remoteFile,
boolean recursive)
Copy local files to the server. |
void |
copyToRemote(java.lang.String localFile,
java.lang.String remoteFile,
boolean recursive)
Copy a single local file or directory to the remote server |
void |
setProgress(SSHFileTransferProgress progress)
Associate a SSHFileTransferProgress object with
this file transfer object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_COPY_BUFFER_SZ
Constructor Detail |
---|
public SSHSCP1(java.io.File cwd, SSHConsoleRemote remote, boolean verbose)
cwd
- local directory names are specified relatively to.remote
- the remote ssh console instance to transfer files
oververbose
- if true the verbose progress is reportedMethod Detail |
---|
public void setProgress(SSHFileTransferProgress progress)
SSHFileTransfer
SSHFileTransferProgress
object with
this file transfer object. The associated object will get
reports on any transfer progress.
setProgress
in interface SSHFileTransfer
progress
- Object which will get progress reports.public void abort()
SSHFileTransfer
abort
in interface SSHFileTransfer
public void copyToRemote(java.lang.String localFile, java.lang.String remoteFile, boolean recursive) throws java.io.IOException
localFile
- local file to copyremoteFile
- remote namerecursive
- if true and the local file is a directory then
the entire content of that directory is copied as well.
java.io.IOException
public void copyToRemote(java.lang.String[] localFiles, java.lang.String remoteFile, boolean recursive) throws java.io.IOException
SSHFileTransfer
remoteFile
parameter refers to a directory the all local files are placed
into it. However it is kind of meaningless to specify multiple
local files and one remote regular file since all files will be
copied to the same name.
copyToRemote
in interface SSHFileTransfer
localFiles
- Array of local files to copy.remoteFile
- Name to store file(s) as on server. If this
is a directory then all files are copied to that directory.recursive
- If true recurse into directories and copy all
files found. The directory structure is recreated on the server.
java.io.IOException
public void copyToLocal(java.lang.String localFile, java.lang.String[] remoteFiles, boolean recursive) throws java.io.IOException
SSHFileTransfer
localFile
parameter refers to a directory the all remote files are placed
into it. However it is kind of meaningless to specify multiple
remote files and one local regular file since all files will be
copied to the same name.
copyToLocal
in interface SSHFileTransfer
localFile
- Name to store file(s) as locally. If this
is a directory then all files are copied to that directory.remoteFiles
- Array of files to copy.recursive
- If true recurse into directories and copy all
files found. The directory structure is recreated on the server.
java.io.IOException
public void copyToLocal(java.lang.String localFile, java.lang.String remoteFile, boolean recursive) throws java.io.IOException
localFile
- destination file nameremoteFile
- remote file or directory to copyrecursive
- if true and the remote file is a directory then
the entire content of that directory is copied as well.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |