|
Secure FTP Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jscape.inet.sftp.Sftp
Implements the basic functionality of a SFTP (FTP over SSH) client.
Example usage:
// connection information String hostname = "10.0.0.1"; String username = "jsmith"; String password = "secret"; // create com.jscape.inet.ssh.util.SshParameters instance SshParameters params = new SshParameters(hostname,username,password); // create Sftp instance Sftp sftp = new Sftp(params); // connect to SSH server sftp.connect(); // print directory listing to console System.out.println(sftp.getDirListingAsString()); // disconnect from SSH server sftp.disconnect();
| Field Summary | |
static int |
ADAPTIVE_BLOCK_SIZE
Adaptive block transfer size. |
| Constructor Summary | |
Sftp(SshParameters params)
Creates a new client instance. |
|
Sftp(SshParameters params,
java.io.File localDir)
Creates a new client instance. |
|
Sftp(SshParameters params,
java.io.File localDir,
com.jscape.inet.sftp.SftpConfiguration config)
Creates a new client instance. |
|
Sftp(SshParameters params,
com.jscape.inet.sftp.SftpConfiguration config)
Creates a new client instance. |
|
| Method Summary | |
void |
addSftpListener(SftpListener listener)
Adds event listener. |
static void |
clearProxySettings()
Clears proxy server values. |
void |
connect()
Establishes secure connection with SSH server. |
void |
deleteDir(java.lang.String remoteDirectory)
Deletes directory from SSH server. |
void |
deleteDir(java.lang.String remoteDirectory,
boolean recurse)
Deletes directory from SSH server recursively. |
void |
deleteFile(java.lang.String remoteFile)
Deletes file from SSH server. |
void |
disconnect()
Disconnects from the remote host. |
void |
download(java.io.OutputStream out,
java.lang.String remoteFile)
Downloads file from SSH server and writes to specified OutputStream. |
java.io.File |
download(java.lang.String remoteFile)
Downloads file from SSH server. |
java.io.File |
download(java.lang.String localFile,
java.lang.String remoteFile)
Downloads the file from SSH server. |
void |
downloadDir(java.lang.String remoteDirectory)
Downloads remote directory and contents recursively from SSH server. |
void |
downloadDir(java.lang.String remoteDir,
int retryLimit)
Downloads remote directory and contents from SSH server. |
int |
getBlockSize()
Gets upload block size. |
java.io.PrintStream |
getDebugStream()
Gets PrintStream used in reporting debugging statements. |
java.lang.String |
getDir()
Gets current working directory of SSH server. |
java.util.Enumeration |
getDirListing()
Gets directory listing from SSH server. |
java.util.Enumeration |
getDirListing(java.lang.String regex)
Gets directory listing from SSH server where file names matches the regular expression. |
java.lang.String |
getDirListingAsString()
Gets directory listing of files on SSH server. |
java.lang.String |
getDirListingAsString(java.lang.String regex)
Gets directory listing from SSH server where file names matches the regular expression. |
int |
getDownloadBlockSize()
Gets the current download buffer size. |
int |
getFilePermissions(java.lang.String remoteFile)
Gets remote file permissions in UNIX chmod format (644, 777). |
long |
getFilesize(java.lang.String remoteFile)
Gets filesize of remote file from SSH server. |
java.util.Date |
getFileTimestamp(java.lang.String remoteFile)
Gets date/timestamp of remote file from SSH server. |
SshHostKeys |
getHostKeys()
Gets SSH host keys for further use. |
java.io.InputStream |
getInputStream(java.lang.String filename,
long offset)
Gets an InputStream from SSH server for the purposes of downloading a file. |
java.lang.String |
getLineTerminator()
Gets destination line terminator used in ASCII file transfers. |
java.io.File |
getLocalDir()
Gets local directory to be used in SSH session. |
java.util.Enumeration |
getLocalDirListing()
Gets local directory listing. |
java.util.Enumeration |
getLocalDirListing(java.lang.String regex)
Gets local directory listing. |
int |
getMode()
Gets data transfer mode for current session. |
java.util.Enumeration |
getNameListing()
Gets directory listing of files on SSH server. |
java.util.Enumeration |
getNameListing(java.lang.String regex)
Gets the remote directory content names. |
java.io.OutputStream |
getOutputStream(java.lang.String filename,
long offset,
boolean append)
Gets an OutputStream from SSH server for the purposes of uploading a file. |
java.lang.String |
getRealPath(java.lang.String path)
Gets real server path. |
int |
getTimeout()
Gets the current connection timeout value. |
int |
getUploadBlockSize()
Gets the current upload buffer size. |
void |
interrupt()
Interrupts the current data transfer and sets interrupted flag to true. |
boolean |
interrupted()
Checks if transfer process was interrupted. |
boolean |
isConnected()
Tests whether the current service is connected to the remote host. |
boolean |
isDirectory(java.lang.String remotePath)
Checks if remote pathname denotes a directory. |
boolean |
isValidPath(java.lang.String path)
Checks if path is valid, i.e. |
void |
makeDir(java.lang.String newDirectory)
Makes directory on SSH server. |
void |
makeDirRecursive(java.lang.String newDirectory)
Makes directory on SSH server, creating subdirectories if necessary. |
java.io.File |
makeLocalDir(java.lang.String directoryName)
Creates local directory. |
void |
mdelete(java.lang.String regex)
Deletes multiple files matching regular expression from SSH server's current directory. |
void |
mdownload(java.util.Enumeration fileNames)
Downloads specified files in current working remote directory from SSH server to local directory. |
void |
mdownload(java.lang.String regex)
Downloads multiple files matching filter from SSH server's current directory. |
void |
mupload(java.util.Enumeration fileNames)
Uploads multiple files to SSH server. |
void |
mupload(java.lang.String regex)
Uploads multiple files matching filter to SSH server's current directory. |
void |
removeSftpListener(SftpListener listener)
Removes specified SSH event listener. |
void |
renameFile(java.lang.String remoteFile,
java.lang.String newFile)
Renames remote file on SSH server. |
void |
reset()
Resets the interrupted flag to false. |
java.io.File |
resumeDownload(java.lang.String remoteFile,
long off)
Resumes download of file from SSH server. |
java.io.File |
resumeDownload(java.lang.String localFile,
java.lang.String remoteFile,
long off)
Resumes download of file from SSH server. |
void |
resumeUpload(java.io.File localFile,
long off)
Resumes upload of file to SSH server. |
void |
resumeUpload(java.io.File localFile,
java.lang.String remoteFile,
long off)
Resumes upload of file to SSH server. |
void |
resumeUpload(java.lang.String localFile,
long off)
Resumes upload of file to SSH server. |
void |
resumeUpload(java.lang.String localFile,
java.lang.String remoteFile,
long off)
Resumes upload of file to SSH server. |
void |
setAscii()
Sets data transfer mode to ASCII. |
void |
setAuto(boolean auto)
Sets data transfer mode to automatic detect Any files with a base Content-Type value of text will be transferred using ASCII, all other files will be transfered using binary. |
void |
setBinary()
Sets data transfer mode to binary. |
void |
setBlockSize(int blockSize)
Deprecated. see #setUploadBlockSize |
void |
setDebug(boolean debug)
Sets debugging state. |
void |
setDebugStream(java.io.PrintStream debugStream)
Sets PrintStream used in reporting debugging statements. |
void |
setDir(java.lang.String remoteDirectory)
Sets current directory on SSH server. |
void |
setDirUp()
Sets current directory on SSH server to parent directory. |
void |
setDownloadBlockSize(int blockSize)
Sets the transfer buffer size for download operation. |
void |
setFilePermissions(java.lang.String remoteFile,
int permissions)
Sets file permissions. |
void |
setLineTerminator(java.lang.String lineTerminator)
Sets destination line terminator used in ASCII file transfers. |
void |
setLocalDir(java.io.File localDirectory)
Sets local directory to be used in session. |
void |
setProxyAuthentication(java.lang.String proxyUsername,
java.lang.String proxyPassword)
Sets the proxy authentication username and password to use with proxy server. |
void |
setProxyHost(java.lang.String proxyHostname,
int proxyPort)
Sets the proxy hostname and port for this connection. |
void |
setProxyType(java.lang.String proxyType)
Sets the proxy type will be used for this FTP connection. |
void |
setReceiveBufferSize(int receiveBufferSize)
Sets the receive buffer size option of the sftp connection. |
void |
setSendBufferSize(int sendBufferSize)
Sets the send buffer size option of the sftp connection. |
void |
setTimeout(int timeout)
Sets the timeout for opening connection to SSH server. |
void |
setUploadBlockSize(int blockSize)
Sets the transfer buffer size for upload operations. |
void |
upload(byte[] data,
java.lang.String remoteFile)
Uploads file to SSH server where contents of file is not on disk but in memory. |
void |
upload(byte[] data,
java.lang.String remoteFile,
boolean append)
Uploads file to SSH server where contents of file is not on disk but in memory. |
void |
upload(java.io.File localFile)
Uploads file to SSH server. |
void |
upload(java.io.File localFile,
boolean append)
Uploads file to SSH server. |
void |
upload(java.io.File localFile,
java.lang.String remoteFile)
Uploads file to SSH server. |
void |
upload(java.io.File localFile,
java.lang.String remoteFile,
boolean append)
Uploads file to SSH server. |
void |
upload(java.io.InputStream input,
java.lang.String remoteFile)
Uploads file to SSH server. |
void |
upload(java.io.InputStream input,
java.lang.String remoteFile,
boolean append)
Uploads file to SSH server. |
void |
upload(java.lang.String localFile)
Uploads file to SSH server. |
void |
upload(java.lang.String localFile,
boolean append)
Uploads file to SSH server. |
void |
upload(java.lang.String extension,
java.io.File localFile)
Uploads a file to SSH server. |
void |
upload(java.lang.String localFile,
java.lang.String remoteFile)
Uploads file to SSH server. |
void |
upload(java.lang.String localFile,
java.lang.String remoteFile,
boolean append)
Uploads file to SSH server. |
void |
uploadDir(java.io.File localDirectory)
Uploads local directory and contents recursively to SSH server. |
void |
uploadDir(java.io.File localDir,
int retryLimit)
Uploads local directory and contents. |
void |
uploadDir(java.io.File localDir,
int retryLimit,
java.lang.String extension)
Uploads local directory and contents. |
void |
uploadDir(java.io.File localDirectory,
java.lang.String remoteDirName,
java.lang.String extension)
Uploads local directory and contents recursively to SSH server. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ADAPTIVE_BLOCK_SIZE
| Constructor Detail |
public Sftp(SshParameters params)
params - the connection parameters
public Sftp(SshParameters params,
com.jscape.inet.sftp.SftpConfiguration config)
params - the connection parametersconfig - the connection configuration
public Sftp(SshParameters params,
java.io.File localDir)
params - the connection parameterslocalDir - the local working directory
public Sftp(SshParameters params,
java.io.File localDir,
com.jscape.inet.sftp.SftpConfiguration config)
params - the connection parameterslocalDir - the local working directoryconfig - the connection configuration| Method Detail |
public void setProxyAuthentication(java.lang.String proxyUsername,
java.lang.String proxyPassword)
proxyUsername - the proxy usernameproxyPassword - the proxy passwordclearProxySettings()
public void setProxyHost(java.lang.String proxyHostname,
int proxyPort)
proxyHostname - the hostname or ip address of the proxy serverproxyPort - the port of the proxy server to connect toclearProxySettings()public void setProxyType(java.lang.String proxyType)
proxyType - The proxy type. Values allowed: HTTP, SOCKS5public static void clearProxySettings()
public void addSftpListener(SftpListener listener)
listener - the listener to addpublic void removeSftpListener(SftpListener listener)
listener - the listener to removepublic int getTimeout()
public void setTimeout(int timeout)
timeout - the timeout in millisecondspublic int getMode()
public void setAscii()
public void setBinary()
public void setAuto(boolean auto)
auto - true to turn automatic detect on
false to turn offpublic void setBlockSize(int blockSize)
blockSize - the size in bytespublic int getBlockSize()
public void setUploadBlockSize(int blockSize)
blockSize - desired buffer sizepublic int getUploadBlockSize()
public void setDownloadBlockSize(int blockSize)
blockSize - desired buffer sizepublic int getDownloadBlockSize()
public void setLineTerminator(java.lang.String lineTerminator)
null. If null, SFTP server must support ASCII transfers
and it will be the responsibility of server to perform conversion. Otherwise,
client will perform conversion from local system line terminator to specified
destination line terminator during transfer.
lineTerminator - line terminatorpublic java.lang.String getLineTerminator()
null. If null, SFTP server must support ASCII transfers
and it will be the responsibility of server to perform conversion. Otherwise,
client will perform conversion from local system line terminator to specified
destination line terminator during transfer.
public void setDebug(boolean debug)
System.out.
debug - true to turn debugging onsetDebugStream(java.io.PrintStream)public void setDebugStream(java.io.PrintStream debugStream)
PrintStream is System.out.
debugStream - the PrintStream to send debug statements toPrintStreampublic java.io.PrintStream getDebugStream()
PrintStream used in reporting debugging statements.
Default PrintStream is System.out.
PrintStream to send debug statements toPrintStreampublic boolean isConnected()
true if the service is connected;
false otherwise
public void connect()
throws com.jscape.inet.sftp.SftpException
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.SshParameterspublic void disconnect()
public java.lang.String getDir()
public void setDir(java.lang.String remoteDirectory)
throws com.jscape.inet.sftp.SftpException
remoteDirectory - the remote directory
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void setDirUp()
throws com.jscape.inet.sftp.SftpException
com.jscape.inet.sftp.SftpException - If an error occurspublic java.io.File getLocalDir()
public void setLocalDir(java.io.File localDirectory)
localDirectory - the local directory
public java.util.Enumeration getDirListing()
throws com.jscape.inet.sftp.SftpException
Enumeration of SftpFile objects
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.SftpFile,
getDirListingAsString()
public java.util.Enumeration getDirListing(java.lang.String regex)
throws com.jscape.inet.sftp.SftpException
regex - Regular expression used to obtain the file list
com.jscape.inet.sftp.SftpException - If an error occurs.
public java.lang.String getDirListingAsString()
throws com.jscape.inet.sftp.SftpException
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.lang.String getDirListingAsString(java.lang.String regex)
throws com.jscape.inet.sftp.SftpException
regex - regular expression used to obtain the file list
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.util.Enumeration getNameListing()
throws com.jscape.inet.sftp.SftpException
Enumeration of String where each item represents a file
or directory name
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.util.Enumeration getNameListing(java.lang.String regex)
throws com.jscape.inet.sftp.SftpException
regex - regular expression used to obtain the file list
Enumeration of String containing filenames
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.public java.util.Enumeration getLocalDirListing(java.lang.String regex)
regex - Regular expression used to obtain the file list
Enumeration of Filepublic java.util.Enumeration getLocalDirListing()
Enumeration of File
public void makeDir(java.lang.String newDirectory)
throws com.jscape.inet.sftp.SftpException
newDirectory - name of directory to make
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void makeDirRecursive(java.lang.String newDirectory)
throws com.jscape.inet.sftp.SftpException
newDirectory - full path of directory to make
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurspublic java.io.File makeLocalDir(java.lang.String directoryName)
directoryName - name of directory
getLocalDir()
public void deleteDir(java.lang.String remoteDirectory)
throws com.jscape.inet.sftp.SftpException
remoteDirectory - the directory to delete
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void deleteDir(java.lang.String remoteDirectory,
boolean recurse)
throws com.jscape.inet.sftp.SftpException
remoteDirectory - the directory to delete.recurse - true if directory contents should be deleted recursively
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public boolean isDirectory(java.lang.String remotePath)
throws com.jscape.inet.sftp.SftpException
remotePath - remote pathname
true if remote pathname denotes a directory; false otherwise
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public int getFilePermissions(java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
remoteFile - the remote filename
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void setFilePermissions(java.lang.String remoteFile,
int permissions)
throws com.jscape.inet.sftp.SftpException
remoteFile - remote file namepermissions - UNIX chmod file permissions
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.public void setSendBufferSize(int sendBufferSize)
sendBufferSize - Send buffer size.public void setReceiveBufferSize(int receiveBufferSize)
receiveBufferSize - Receive buffer size.
public java.util.Date getFileTimestamp(java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
remoteFile - the remote filename
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public long getFilesize(java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
remoteFile - the remote file
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.io.InputStream getInputStream(java.lang.String filename,
long offset)
throws com.jscape.inet.sftp.SftpException
InputStream from SSH server for the purposes of downloading a file.
filename - remote file name to downloadoffset - file offset in bytes
InputStream
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.io.OutputStream getOutputStream(java.lang.String filename,
long offset,
boolean append)
throws com.jscape.inet.sftp.SftpException
OutputStream from SSH server for the purposes of uploading a file.
filename - the remote filename to store file asoffset - file offset in bytesappend - true to append to remote file on SSH server, false otherwise
OutputStream
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void deleteFile(java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
remoteFile - the file to delete
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void mdelete(java.lang.String regex)
throws com.jscape.inet.sftp.SftpException
regex - the regular expression to use
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void renameFile(java.lang.String remoteFile,
java.lang.String newFile)
throws com.jscape.inet.sftp.SftpException
remoteFile - name of file to renamenewFile - new name of file
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.lang.String getRealPath(java.lang.String path)
throws com.jscape.inet.sftp.SftpException
path - path to resolve
com.jscape.inet.sftp.SftpException - if an error occcurs
public boolean isValidPath(java.lang.String path)
throws com.jscape.inet.sftp.SftpException
path - path to check
true if path is valid;
false otherwise
com.jscape.inet.sftp.SftpException - if an error occurspublic void interrupt()
true.
After invoking this method you must reset the interrupted flag to false
before transferring any files.
reset()public boolean interrupted()
true if transfer process was interrupted;
false otherwisepublic void reset()
false.
This method should be invoked if you have interrupted a transfer
using the Sftp#interrupt method and wish to resume transfering files.
interrupt()
public java.io.File download(java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
remoteFile - the remote file to download
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.io.File download(java.lang.String localFile,
java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to downloadremoteFile - the remote file to download
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void download(java.io.OutputStream out,
java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
OutputStream.
out - the OutputStream to write file toremoteFile - the remote file to download
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public java.io.File resumeDownload(java.lang.String remoteFile,
long off)
throws com.jscape.inet.sftp.SftpException
remoteFile - the file to downloadoff - file offset in bytes
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(File)
public java.io.File resumeDownload(java.lang.String localFile,
java.lang.String remoteFile,
long off)
throws com.jscape.inet.sftp.SftpException
localFile - local file nameremoteFile - the file to downloadoff - file offset in bytes
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(File)
public void downloadDir(java.lang.String remoteDirectory)
throws com.jscape.inet.sftp.SftpException
remoteDirectory - the directory to download
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(File)
public void downloadDir(java.lang.String remoteDir,
int retryLimit)
throws com.jscape.inet.sftp.SftpException
remoteDir - the directory to downloadretryLimit - The retry limit number
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(java.io.File)
public void mdownload(java.util.Enumeration fileNames)
throws com.jscape.inet.sftp.SftpException
downloadDir(String) method.
Downloads are stored relative to current local directory.
fileNames - filenames of files to download
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.downloadDir(String),
setLocalDir(File)
public void mdownload(java.lang.String regex)
throws com.jscape.inet.sftp.SftpException
downloadDir method.
regex - the filter to use
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.downloadDir(java.lang.String),
setLocalDir(File)
public void upload(byte[] data,
java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
data - the raw contents of the file to uploadremoteFile - the filename to store file as on SSH server
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void upload(java.io.InputStream input,
java.lang.String remoteFile,
boolean append)
throws com.jscape.inet.sftp.SftpException
input - the input stream to read fromremoteFile - the filename to store file as on SSH serverappend - true to append to remote file, false otherwise
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs
public void upload(java.io.InputStream input,
java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
input - the input stream to read fromremoteFile - the filename to store file as on SSH server
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs
public void upload(byte[] data,
java.lang.String remoteFile,
boolean append)
throws com.jscape.inet.sftp.SftpException
data - the raw contents of the file to uploadremoteFile - the filename to store file as on SSH serverappend - true to appending to remote file
on SSH server; false otherwise
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void upload(java.io.File localFile)
throws com.jscape.inet.sftp.SftpException
localFile is a directory then directory and entire contents
are uploaded.
localFile - the local file to upload
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void upload(java.lang.String extension,
java.io.File localFile)
throws com.jscape.inet.sftp.SftpException
extension - The extension will be usedlocalFile - The local file to upload
com.jscape.inet.sftp.SftpException - if an I/O or SSH related error occurs
public void upload(java.io.File localFile,
boolean append)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadappend - true to appending to remote file
on SSH server, false otherwise
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void upload(java.io.File localFile,
java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
localFile is a directory then directory and entire contents
are uploaded.
localFile - the local file to uploadremoteFile - the destination of upload
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void upload(java.io.File localFile,
java.lang.String remoteFile,
boolean append)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadremoteFile - the destination of uploadappend - true to appending to remote file
on SSH server, false otherwise
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void upload(java.lang.String localFile)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to upload
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(File)
public void upload(java.lang.String localFile,
boolean append)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadappend - true to appending to remote file
on SSH server, false otherwise
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void upload(java.lang.String localFile,
java.lang.String remoteFile)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadremoteFile - the destination filename of upload
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(File)
public void upload(java.lang.String localFile,
java.lang.String remoteFile,
boolean append)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadremoteFile - the destination filename of uploadappend - true to appending to remote file
on SSH server, false otherwise
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(File)
public void resumeUpload(java.io.File localFile,
long off)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadoff - file offset in bytes
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void resumeUpload(java.io.File localFile,
java.lang.String remoteFile,
long off)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadremoteFile - the destination remote fileoff - the local file offset in bytes
com.jscape.inet.sftp.SftpException - if an I/O or SSH related error occurs
public void resumeUpload(java.lang.String localFile,
long off)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadoff - file offset in bytes
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.setLocalDir(File)
public void resumeUpload(java.lang.String localFile,
java.lang.String remoteFile,
long off)
throws com.jscape.inet.sftp.SftpException
localFile - the local file to uploadremoteFile - the remote destination fileoff - the local file offset in bytes
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurssetLocalDir(File)
public void uploadDir(java.io.File localDirectory)
throws com.jscape.inet.sftp.SftpException
localDirectory - the directory to upload
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void uploadDir(java.io.File localDir,
int retryLimit)
throws com.jscape.inet.sftp.SftpException
localDir - the directory to uploadretryLimit - number of times to retry if upload fails
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void uploadDir(java.io.File localDir,
int retryLimit,
java.lang.String extension)
throws com.jscape.inet.sftp.SftpException
localDir - the directory to uploadretryLimit - number of times to retry if upload failsextension - the temporary extension which will be used to upload the files or null for default extension
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void uploadDir(java.io.File localDirectory,
java.lang.String remoteDirName,
java.lang.String extension)
throws com.jscape.inet.sftp.SftpException
localDirectory - the directory to uploadremoteDirName - the remote directory nameextension - The extension which will be used to upload the files
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void mupload(java.util.Enumeration fileNames)
throws com.jscape.inet.sftp.SftpException
fileNames - filenames of files to upload
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.
public void mupload(java.lang.String regex)
throws com.jscape.inet.sftp.SftpException
regex - the regular expression to use
com.jscape.inet.sftp.SftpException - if an I/O or SSH error occurs.public SshHostKeys getHostKeys()
null if keys are not available
|
Secure FTP Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||