public abstract class SftpClientTask extends Task
Constructor and Description |
---|
SftpClientTask(SshClient ssh) |
SftpClientTask(com.sshtools.common.ssh.SshConnection con) |
Modifier and Type | Method and Description |
---|---|
void |
addCustomRoot(java.lang.String rootPath)
Add a custom file system root path such as "flash:"
|
void |
cd(java.lang.String dir)
Changes the working directory on the remote server, or the user's default
directory if
null or any empty string is provided as the
directory path. |
void |
cdup()
Change the working directory to the parent directory
|
void |
chgrp(java.lang.String gid,
java.lang.String path)
Sets the group ID for the file or directory.
|
void |
chmod(int permissions,
java.lang.String path)
Changes the access permissions or modes of the specified file or
directory.
|
void |
chown(java.lang.String uid,
java.lang.String path)
Sets the user ID to owner for the file or directory.
|
protected abstract void |
doSftp() |
protected void |
doTask() |
void |
exit()
Close the SFTP client.
|
static java.lang.String |
formatLongname(SftpFile file)
Format a String with the details of the file.
|
static java.lang.String |
formatLongname(com.sshtools.common.sftp.SftpFileAttributes attrs,
java.lang.String filename)
Format a String with the details of the file.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String path)
Download the remote file to the local computer
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String path,
boolean resume)
Download the remote file to the local computer
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String path,
FileTransferProgress progress)
Download the remote file to the local computer.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String path,
FileTransferProgress progress,
boolean resume)
Download the remote file to the local computer.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.io.OutputStream local)
Download the remote file into an OutputStream.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.io.OutputStream local,
FileTransferProgress progress)
Download the remote file writing it to the specified
OutputStream . |
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.io.OutputStream local,
FileTransferProgress progress,
long position)
Download the remote file writing it to the specified
OutputStream . |
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.io.OutputStream local,
long position)
Download the remote file into an OutputStream.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.lang.String local)
Download the remote file into the local file.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.lang.String local,
boolean resume)
Download the remote file into the local file.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.lang.String local,
FileTransferProgress progress)
Download the remote file to the local computer.
|
com.sshtools.common.sftp.SftpFileAttributes |
get(java.lang.String remote,
java.lang.String local,
FileTransferProgress progress,
boolean resume)
Download the remote file to the local computer.
|
java.lang.String |
getAbsolutePath(java.lang.String path)
Get the absolute path for a file.
|
java.lang.String |
getDefaultDirectory()
Get the default directory (or HOME directory)
|
int |
getEOL(byte[] nl) |
int |
getEOL(java.lang.String line) |
SftpFile[] |
getFiles(java.lang.String remote)
Download the remote files to the local computer
|
SftpFile[] |
getFiles(java.lang.String remote,
boolean resume)
Download the remote files to the local computer
|
SftpFile[] |
getFiles(java.lang.String remote,
FileTransferProgress progress)
Download the remote files to the local computer.
|
SftpFile[] |
getFiles(java.lang.String remote,
FileTransferProgress progress,
boolean resume)
Download the remote files to the local computer.
|
SftpFile[] |
getFiles(java.lang.String remote,
java.lang.String local)
Download the remote files into the local file.
|
SftpFile[] |
getFiles(java.lang.String remote,
java.lang.String local,
boolean resume)
Download the remote files into the local file.
|
SftpFile[] |
getFiles(java.lang.String remote,
java.lang.String local,
FileTransferProgress progress,
boolean resume)
Download the remote file to the local computer.
|
java.io.InputStream |
getInputStream(java.lang.String remotefile)
Create an InputStream for reading a remote file.
|
java.io.InputStream |
getInputStream(java.lang.String remotefile,
long position)
Create an InputStream for reading a remote file.
|
java.io.OutputStream |
getOutputStream(java.lang.String remotefile)
Create an OutputStream for writing to a remote file.
|
DirectoryOperation |
getRemoteDirectory(java.lang.String remotedir,
java.lang.String localdir,
boolean recurse,
boolean sync,
boolean commit,
FileTransferProgress progress)
Copy the contents of a remote directory to a local directory
|
int |
getRemoteEOL() |
java.lang.String |
getRemoteNewline() |
SftpChannel |
getSubsystemChannel()
Returns the instance of the AbstractSftpChannel used by this class
|
java.lang.String |
getSymbolicLinkTarget(java.lang.String linkpath)
Get the target path of a symbolic link.
|
int |
getTransferMode() |
boolean |
isClosed()
Returns the state of the SFTP client.
|
boolean |
isDirectoryOrLinkedDirectory(SftpFile file)
Determine whether the file object is pointing to a symbolic link that is
pointing to a directory.
|
void |
lcd(java.lang.String path)
Changes the local working directory.
|
java.lang.String |
lpwd()
Returns the absolute path to the local working directory.
|
SftpFile[] |
ls()
List the contents of the current remote working directory.
|
SftpFile[] |
ls(java.lang.String path)
List the contents remote directory.
|
SftpFile[] |
matchRemoteFiles(java.lang.String remote)
Called by getFileMatches() to do regular expression pattern matching on
the files in 'remote''s parent directory.
|
void |
mkdir(java.lang.String dir)
Creates a new directory on the remote server.
|
void |
mkdirs(java.lang.String dir)
Create a directory or set of directories.
|
SftpFile |
openDirectory(java.lang.String path) |
SftpFile |
openFile(java.lang.String fileName) |
SftpFile |
openFile(java.lang.String fileName,
int flags) |
void |
put(java.io.InputStream in,
java.lang.String remote)
Upload the contents of an InputStream to the remote computer.
|
void |
put(java.io.InputStream in,
java.lang.String remote,
FileTransferProgress progress)
Upload a file to the remote computer reading from the specified
InputStream . |
void |
put(java.io.InputStream in,
java.lang.String remote,
FileTransferProgress progress,
long position) |
void |
put(java.io.InputStream in,
java.lang.String remote,
long position)
Upload the contents of an InputStream to the remote computer.
|
void |
put(java.lang.String local)
Upload a file to the remote computer
|
void |
put(java.lang.String local,
boolean resume)
Upload a file to the remote computer
|
void |
put(java.lang.String local,
FileTransferProgress progress)
Upload a file to the remote computer.
|
void |
put(java.lang.String local,
FileTransferProgress progress,
boolean resume)
Upload a file to the remote computer.
|
void |
put(java.lang.String local,
java.lang.String remote)
Upload a file to the remote computer
|
void |
put(java.lang.String local,
java.lang.String remote,
boolean resume)
Upload a file to the remote computer
|
void |
put(java.lang.String local,
java.lang.String remote,
FileTransferProgress progress)
Upload a file to the remote computer.
|
void |
put(java.lang.String local,
java.lang.String remote,
FileTransferProgress progress,
boolean resume)
Upload a file to the remote computer.
|
void |
putFiles(java.lang.String local)
Upload the contents of an InputStream to the remote computer.
|
void |
putFiles(java.lang.String local,
boolean resume)
Upload files to the remote computer
|
void |
putFiles(java.lang.String local,
FileTransferProgress progress)
Upload files to the remote computer
|
void |
putFiles(java.lang.String local,
FileTransferProgress progress,
boolean resume)
Upload files to the remote computer
|
void |
putFiles(java.lang.String local,
java.lang.String remote)
Upload files to the remote computer
|
void |
putFiles(java.lang.String local,
java.lang.String remote,
boolean resume)
Upload files to the remote computer
|
void |
putFiles(java.lang.String local,
java.lang.String remote,
FileTransferProgress progress)
Upload files to the remote computer.
|
void |
putFiles(java.lang.String local,
java.lang.String remote,
FileTransferProgress progress,
boolean resume)
make local copies of some of the variables, then call putfilematches,
which calls "put" on each file that matches the regexp local.
|
DirectoryOperation |
putLocalDirectory(java.lang.String localdir,
java.lang.String remotedir,
boolean recurse,
boolean sync,
boolean commit,
FileTransferProgress progress)
Copy the contents of a local directory into a remote directory.
|
java.lang.String |
pwd()
Returns the absolute path name of the current remote working directory.
|
void |
quit()
Close the SFTP client.
|
java.util.List<SftpFile> |
readDirectory(SftpFile dir) |
void |
removeCustomRoot(java.lang.String rootPath)
Remove a custom file system root path such as "flash:"
|
void |
rename(java.lang.String oldpath,
java.lang.String newpath)
Rename a file on the remote computer.
|
void |
rm(java.lang.String path)
Remove a file or directory from the remote computer.
|
void |
rm(java.lang.String path,
boolean force,
boolean recurse)
Remove a file or directory on the remote computer with options to force
deletion of existing files and recursion.
|
void |
setBlockSize(int blocksize)
Sets the block size used when transferring files, defaults to the
optimized setting of 32768.
|
void |
setBufferSize(int buffersize)
Set the size of the buffer which is used to read from the local file
system.
|
void |
setForceRemoteEOL(boolean forceRemoteEOL)
Override automatic detection of the remote EOL (any SFTP version).
|
void |
setLocalEOL(int eolMode)
Override the default local system EOL for text mode files.
|
void |
setMaxAsyncRequests(int asyncRequests)
Set the maximum number of asynchronous requests that are outstanding at
any one time.
|
void |
setRegularExpressionSyntax(int syntax)
sets the type of regular expression matching to perform on gets and puts
|
void |
setRemoteEOL(int eolMode)
When connected to servers running SFTP version 3 (or less) the remote EOL
type needs to be explicitly set because there is no reliable way for the
client to determine the type of EOL for text files.
|
void |
setTransferMode(int transferMode)
Sets the transfer mode for current operations.
|
com.sshtools.common.sftp.SftpFileAttributes |
stat(java.lang.String path)
Returns the attributes of the file from the remote computer.
|
com.sshtools.common.sftp.SftpFileAttributes |
statLink(java.lang.String path)
Returns the attributes of the link from the remote computer.
|
void |
symlink(java.lang.String path,
java.lang.String link)
Create a symbolic link on the remote computer.
|
int |
umask(int umask)
Sets the umask used by this client.
|
void |
umask(java.lang.String umask)
Sets the umask for this client.
|
boolean |
verifyFiles(java.lang.String localFile,
java.lang.String remoteFile)
Verify a local and remote file.
|
boolean |
verifyFiles(java.lang.String localFile,
java.lang.String remoteFile,
long offset,
long length)
Verify a local and remote file.
|
addFutureListener, done, isDone, isSuccess, waitFor, waitForever
public SftpClientTask(com.sshtools.common.ssh.SshConnection con)
public SftpClientTask(SshClient ssh)
protected void doTask()
doTask
in class com.sshtools.common.ssh.ConnectionAwareTask
protected abstract void doSftp()
public void setBlockSize(int blocksize)
blocksize
- public SftpChannel getSubsystemChannel()
public void setTransferMode(int transferMode)
Sets the transfer mode for current operations. The valid modes are:
#MODE_BINARY
- Files are transferred in binary mode and no
processing of text files is performed (default mode).
#MODE_TEXT
- For servers supporting version 4+ of the SFTP
protocol files are transferred in text mode. For earlier protocol
versions the files are transfered in binary mode but the client performs
processing of text; if files are written to the remote server the client
ensures that the line endings conform to the remote EOL mode set using
setRemoteEOL(int)
. For files retrieved from the server the EOL
policy is based upon System policy as defined by the "line.seperator"
system property.
transferMode
- intpublic void setRemoteEOL(int eolMode)
When connected to servers running SFTP version 3 (or less) the remote EOL type needs to be explicitly set because there is no reliable way for the client to determine the type of EOL for text files. In versions 4+ a mechanism is provided and this setting is overridden.
Valid values for this method are EOL_CRLF
(default),
EOL_CR
, and EOL_LF
.
eolMode
- intpublic void setLocalEOL(int eolMode)
Override the default local system EOL for text mode files.
Valid values for this method are EOL_CRLF
(default),
EOL_CR
, and EOL_LF
.
eolMode
- intpublic void setForceRemoteEOL(boolean forceRemoteEOL)
forceRemoteEOL
- public int getTransferMode()
public void setBufferSize(int buffersize)
buffersize
- public void setMaxAsyncRequests(int asyncRequests)
asyncRequests
- public int umask(int umask)
To give yourself full permissions for both files and directories and prevent the group and other users from having access: umask(077); This subtracts 077 from the system defaults for files and directories 666 and 777. Giving a default access permissions for your files of 600 (rw-------) and for directories of 700 (rwx------). To give all access permissions to the group and allow other users read and execute permission: umask(002); This subtracts 002 from the system defaults to give a default access permission for your files of 664 (rw-rw-r--) and for your directories of 775 (rwxrwxr-x). To give the group and other users all access except write access: umask(022); This subtracts 022 from the system defaults to give a default access permission for your files of 644 (rw-r--r--) and for your directories of 755 (rwxr-xr-x).
umask
- public SftpFile openFile(java.lang.String fileName) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public SftpFile openFile(java.lang.String fileName, int flags) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public SftpFile openDirectory(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public java.util.List<SftpFile> readDirectory(SftpFile dir) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void cd(java.lang.String dir) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Changes the working directory on the remote server, or the user's default
directory if null
or any empty string is provided as the
directory path. The user's default directory is typically their home
directory but is dependent upon server implementation.
dir
- the new working directoryjava.io.IOException
- if an IO error occurs or the file does not existcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public java.lang.String getDefaultDirectory() throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Get the default directory (or HOME directory)
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void cdup() throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void addCustomRoot(java.lang.String rootPath)
rootPath
- public void removeCustomRoot(java.lang.String rootPath)
rootPath
- public void mkdir(java.lang.String dir) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Creates a new directory on the remote server. This method will throw an
exception if the directory already exists. To create directories and
disregard any errors use the mkdirs
method.
dir
- the name of the new directorycom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void mkdirs(java.lang.String dir) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Create a directory or set of directories. This method will not fail even if the directories exist. It is advisable to test whether the directory exists before attempting an operation by using stat to return the directories attributes.
dir
- the path of directories to create.com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public boolean isDirectoryOrLinkedDirectory(SftpFile file) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public java.lang.String pwd() throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Returns the absolute path name of the current remote working directory.
com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
public SftpFile[] ls() throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
List the contents of the current remote working directory.
Returns a list of SftpFile instances for the current working directory.
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public SftpFile[] ls(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
List the contents remote directory.
Returns a list of SftpFile instances for the remote directory.
path
- the path on the remote server to listcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void lcd(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Changes the local working directory.
path
- the path to the new working directorycom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public java.lang.String lpwd() throws java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Returns the absolute path to the local working directory.
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String path, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote file to the local computer.
path
- the path to the remote fileprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String path, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote file to the local computer.
path
- the path to the remote fileprogress
- resume
- attempt to resume a interrupted downloadcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String path, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote file to the local computer
path
- the path to the remote fileresume
- attempt to resume an interrupted downloadcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote file to the local computer
path
- the path to the remote filecom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public java.lang.String getSymbolicLinkTarget(java.lang.String linkpath) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
linkpath
- com.sshtools.common.ssh.SshException
- if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol.com.sshtools.common.sftp.SftpStatusException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.lang.String local, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote file to the local computer. If the paths provided are not absolute the current working directory is used.
remote
- the path/name of the remote filelocal
- the path/name to place the file on the local computerprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.lang.String local, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote file to the local computer. If the paths provided are not absolute the current working directory is used.
remote
- the path/name of the remote filelocal
- the path/name to place the file on the local computerprogress
- resume
- attempt to resume an interrupted downloadcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public java.lang.String getRemoteNewline() throws com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.sftp.SftpStatusException
public int getRemoteEOL() throws com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.sftp.SftpStatusException
public int getEOL(java.lang.String line) throws com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.sftp.SftpStatusException
public int getEOL(byte[] nl) throws com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.sftp.SftpStatusException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.lang.String local, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
remote
- local
- resume
- attempt to resume an interrupted downloadcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.lang.String local) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
remote
- local
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.io.OutputStream local, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
Download the remote file writing it to the specified
OutputStream
. The OutputStream is closed by this method even
if the operation fails.
remote
- the path/name of the remote filelocal
- the OutputStream to writeprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public void setRegularExpressionSyntax(int syntax)
syntax
- , NoSyntax for no regular expression matching, GlobSyntax for
GlobSyntax, Perl5Syntax for Perl5Syntaxpublic SftpFile[] matchRemoteFiles(java.lang.String remote) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
remote
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.io.OutputStream local, FileTransferProgress progress, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
Download the remote file writing it to the specified
OutputStream
. The OutputStream is closed by this method even
if the operation fails.
remote
- the path/name of the remote filelocal
- the OutputStream to writeprogress
- position
- the position within the file to start reading fromcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public java.io.InputStream getInputStream(java.lang.String remotefile, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
remotefile
- position
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public java.io.InputStream getInputStream(java.lang.String remotefile) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
remotefile
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.io.OutputStream local, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
remote
- local
- position
- the position from which to start reading the remote filecom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public com.sshtools.common.sftp.SftpFileAttributes get(java.lang.String remote, java.io.OutputStream local) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
remote
- local
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public boolean isClosed()
Returns the state of the SFTP client. The client is closed if the
underlying session channel is closed. Invoking the quit
method of this object will close the underlying session channel.
public void put(java.lang.String local, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload a file to the remote computer.
local
- the path/name of the local fileprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.lang.String local, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload a file to the remote computer.
local
- the path/name of the local fileprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.lang.String local) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.lang.String local, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- resume
- attempt to resume after an interrupted transfercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.lang.String local, java.lang.String remote, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload a file to the remote computer. If the paths provided are not absolute the current working directory is used.
local
- the path/name of the local fileremote
- the path/name of the destination fileprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.lang.String local, java.lang.String remote, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload a file to the remote computer. If the paths provided are not absolute the current working directory is used.
local
- the path/name of the local fileremote
- the path/name of the destination fileprogress
- resume
- attempt to resume after an interrupted transfercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.lang.String local, java.lang.String remote, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- remote
- resume
- attempt to resume after an interrupted transfercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.lang.String local, java.lang.String remote) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- remote
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void put(java.io.InputStream in, java.lang.String remote, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
Upload a file to the remote computer reading from the specified
InputStream
. The InputStream is closed, even if the operation
fails.
in
- the InputStream being readremote
- the path/name of the destination fileprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public void put(java.io.InputStream in, java.lang.String remote, FileTransferProgress progress, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public java.io.OutputStream getOutputStream(java.lang.String remotefile) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
remotefile
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void put(java.io.InputStream in, java.lang.String remote, long position) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
in
- remote
- position
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public void put(java.io.InputStream in, java.lang.String remote) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException
in
- remote
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public void chown(java.lang.String uid, java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Sets the user ID to owner for the file or directory.
uid
- numeric user id of the new ownerpath
- the path to the remote file/directorycom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
public void chgrp(java.lang.String gid, java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Sets the group ID for the file or directory.
gid
- the numeric group id for the new grouppath
- the path to the remote file/directorycom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void chmod(int permissions, java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Changes the access permissions or modes of the specified file or directory.
Modes determine who can read, change or execute a file.
Absolute modes are octal numbers specifying the complete list of attributes for the files; you specify attributes by OR'ing together these bits. 0400 Individual read 0200 Individual write 0100 Individual execute (or list directory) 0040 Group read 0020 Group write 0010 Group execute 0004 Other read 0002 Other write 0001 Other execute
permissions
- the absolute mode of the file/directorypath
- the path to the file/directory on the remote servercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void umask(java.lang.String umask) throws com.sshtools.common.ssh.SshException
To give yourself full permissions for both files and directories and prevent the group and other users from having access: umask("077"); This subtracts 077 from the system defaults for files and directories 666 and 777. Giving a default access permissions for your files of 600 (rw-------) and for directories of 700 (rwx------). To give all access permissions to the group and allow other users read and execute permission: umask("002"); This subtracts 002 from the system defaults to give a default access permission for your files of 664 (rw-rw-r--) and for your directories of 775 (rwxrwxr-x). To give the group and other users all access except write access: umask("022"); This subtracts 022 from the system defaults to give a default access permission for your files of 644 (rw-r--r--) and for your directories of 755 (rwxr-xr-x).
umask
- com.sshtools.common.ssh.SshException
public void rename(java.lang.String oldpath, java.lang.String newpath) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Rename a file on the remote computer.
oldpath
- the old pathnewpath
- the new pathcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void rm(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Remove a file or directory from the remote computer.
path
- the path of the remote file/directorycom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void rm(java.lang.String path, boolean force, boolean recurse) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- force
- recurse
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public void symlink(java.lang.String path, java.lang.String link) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Create a symbolic link on the remote computer.
path
- the path to the existing filelink
- the new linkcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public com.sshtools.common.sftp.SftpFileAttributes stat(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Returns the attributes of the file from the remote computer.
path
- the path of the file on the remote computercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public com.sshtools.common.sftp.SftpFileAttributes statLink(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
Returns the attributes of the link from the remote computer.
path
- the path of the file on the remote computercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public java.lang.String getAbsolutePath(java.lang.String path) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
path
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public boolean verifyFiles(java.lang.String localFile, java.lang.String remoteFile) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
localFile
- remoteFile
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public boolean verifyFiles(java.lang.String localFile, java.lang.String remoteFile, long offset, long length) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
localFile
- remoteFile
- offset
- length
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void quit() throws com.sshtools.common.ssh.SshException
Close the SFTP client.
com.sshtools.common.ssh.SshException
public void exit() throws com.sshtools.common.ssh.SshException
Close the SFTP client.
com.sshtools.common.ssh.SshException
public DirectoryOperation putLocalDirectory(java.lang.String localdir, java.lang.String remotedir, boolean recurse, boolean sync, boolean commit, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
localdir
- the path to the local directoryremotedir
- the remote directory which will receive the contentsrecurse
- recurse through child folderssync
- synchronize the directories by removing files on the remote
server that do not exist locallycommit
- actually perform the operation. If false a DirectoryOperation will be
returned so that the operation can be evaluated and no actual
files will be created/transfered.progress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public static java.lang.String formatLongname(SftpFile file) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException
-rwxr-xr-x 1 mjos staff 348911 Mar 25 14:29 t-filexfer
file
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
public static java.lang.String formatLongname(com.sshtools.common.sftp.SftpFileAttributes attrs, java.lang.String filename)
-rwxr-xr-x 1 mjos staff 348911 Mar 25 14:29 t-filexfer
attrs
- filename
- public DirectoryOperation getRemoteDirectory(java.lang.String remotedir, java.lang.String localdir, boolean recurse, boolean sync, boolean commit, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
remotedir
- the remote directory whose contents will be copied.localdir
- the local directory to where the contents will be copiedrecurse
- recurse into child folderssync
- synchronized the directories by removing files and directories
that do not exist on the remote server.commit
- actually perform the operation. If false the
operation will be processed and a DirectoryOperation will be
returned without actually transfering any files.progress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public SftpFile[] getFiles(java.lang.String remote) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote files to the local computer
When RegExpSyntax is set to NoSyntax the getFiles() methods act identically to the get() methods except for a different return type.
When RegExpSyntax is set to GlobSyntax or Perl5Syntax, getFiles() treats 'remote' as a regular expression, and gets all the files in 'remote''s parent directory that match the pattern. The default parent directory of remote is the remote cwd unless 'remote' contains file seperators(/).
Examples can be found in SftpConnect.java
Code Example:
// change reg exp syntax from default SftpClient.NoSyntax (no reg exp matching) // to SftpClient.GlobSyntax sftp.setRegularExpressionSyntax(SftpClient.GlobSyntax); // get all .doc files with 'rfc' in their names, in the 'docs/unsorted/' folder // relative to the remote cwd, and copy them to the local cwd. sftp.getFiles("docs/unsorted/*rfc*.doc");
remote
- the regular expression path to the remote filecom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public SftpFile[] getFiles(java.lang.String remote, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote files to the local computer
remote
- the regular expression path to the remote fileresume
- attempt to resume an interrupted downloadcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public SftpFile[] getFiles(java.lang.String remote, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote files to the local computer.
remote
- the regular expression path to the remote fileprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public SftpFile[] getFiles(java.lang.String remote, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote files to the local computer.
remote
- the regular expression path to the remote fileprogress
- resume
- attempt to resume a interrupted downloadcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public SftpFile[] getFiles(java.lang.String remote, java.lang.String local) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
remote
- local
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public SftpFile[] getFiles(java.lang.String remote, java.lang.String local, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
remote
- local
- resume
- attempt to resume an interrupted downloadcom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public SftpFile[] getFiles(java.lang.String remote, java.lang.String local, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Download the remote file to the local computer. If the paths provided are not absolute the current working directory is used.
remote
- the regular expression path/name of the remote fileslocal
- the path/name to place the file on the local computerprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload the contents of an InputStream to the remote computer.
When RegExpSyntax is set to NoSyntax the putFiles() methods act identically to the put() methods except for a different return type.
When RegExpSyntax is set to GlobSyntax or Perl5Syntax, putFiles() treats 'local' as a regular expression, and gets all the files in 'local''s parent directory that match the pattern. The default parent directory of local is the local cwd unless 'local' contains file seperators.
Examples can be found in SftpConnect.java
Code Example:
// change reg exp syntax from default SftpClient.NoSyntax (no reg exp matching) // to SftpClient.GlobSyntax sftp.setRegularExpressionSyntax(SftpClient.GlobSyntax); // put all .doc files with 'rfc' in their names, in the 'docs/unsorted/' folder // relative to the local cwd, and copy them to the remote cwd. sftp.putFiles("docs/unsorted/*rfc*.doc");
local
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- resume
- attempt to resume after an interrupted transfercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload files to the remote computer
local
- the regular expression path/name of the local filesprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload files to the remote computer
local
- the regular expression path/name of the local filesprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local, java.lang.String remote) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- remote
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local, java.lang.String remote, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- remote
- resume
- attempt to resume after an interrupted transfercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local, java.lang.String remote, FileTransferProgress progress) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
Upload files to the remote computer. If the paths provided are not absolute the current working directory is used.
local
- the regular expression path/name of the local filesremote
- the path/name of the destination fileprogress
- com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
public void putFiles(java.lang.String local, java.lang.String remote, FileTransferProgress progress, boolean resume) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, java.io.IOException, com.sshtools.common.permissions.PermissionDeniedException
local
- the regular expression path/name of the local filesremote
- the path/name of the destination fileprogress
- resume
- attempt to resume after an interrupted transfercom.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
com.sshtools.common.permissions.PermissionDeniedException
java.io.IOException
Copyright © 2021. All rights reserved.