|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.enterprisedt.net.ftp.ssh.SCPClient
com.enterprisedt.net.ftp.ssh.SSHFTPClient
public class SSHFTPClient
SSHFTPClient implements SFTP (SSH File Transfer Protocol).
Connections are established when the connect() is invoked.
Before it is called, the remote host must be defined, and
host verification and client authentication should be
configured.
Host Validation is the process of verifying that a host that is
being connected to is the host that was requested. Host validation is
done through an instance of SSHFTPValidator or a subclass
thereof. By default, SSHFTPClient, has an instance of
this class that is available by means of the getValidator()
method. Unless specialized validation functionality is required,
initialization of validation functionality may be done simply by invoking
methods on this object.
There are four approaches to setting up host validation:
ftpClient.getValidator().setHostValidationEnabled(false);
jackspc ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIE...If there are more than one host using a given key the host-name may be replaced by a comma-separated list of host-names. Wildcards may not be used. A host-file is loaded as follows:
ftpClient.getValidator().loadKnownHosts("~/.ssh/known_hosts");
ftpClient.getValidator().addKnownHost("host1pk.pub");
ftpClient.getValidator().addKnownHost("host2pk.pub");
Public keys should be in OpenSSH or SECSH format.
Client Authentication is the method used by the server to authenticate
clients. Different servers will enforce different policies for authenticating
clients. SSHFTPClient currently offers two authentication methods:
setAuthentication as follows:
ftpClient.setAuthentication("jack", "my_ftp_password");
ftpClient.setAuthentication("myprivatekey", "jack", "my_keyfile_password");
The user-name is the name of the user on the SFTP server, but the passphrase
is the password for the key-file (if there is a password).
| Nested Class Summary | |
|---|---|
static class |
SSHFTPClient.ConfigFlags
ConfigFlags contains various static integers which are used
to configure clients. |
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_ENCODING
Default encoding used for control data |
static java.lang.String |
EOL_CRLF
Carriage return + line feed end of line marker |
static java.lang.String |
EOL_LF
Line feed end of line marker |
| Fields inherited from class com.enterprisedt.net.ftp.ssh.SCPClient |
|---|
authenticator, connProps, DEFAULT_PORT, deleteCount, downloadCount, id, license, proxySettings, retryAuthenticator, ssh, uploadCount, validator |
| Fields inherited from interface com.enterprisedt.net.ftp.pro.ProFTPClientInterface |
|---|
cvsId |
| Constructor Summary | |
|---|---|
SSHFTPClient()
Constructs an SFTP client. |
|
| Method Summary | |
|---|---|
void |
cancelResume()
Cancel the resume. |
void |
cancelTransfer()
Cancels the current transfer. |
void |
cdup()
Change the remote working directory to the parent directory |
void |
changeGroup(int gid,
java.lang.String path)
Sets the group ID for the file or directory. |
void |
changeMode(int permissions,
java.lang.String path)
Changes the access permissions or modes of the specified file or directory. |
void |
changeMode(java.lang.String permissions,
java.lang.String path)
Changes the access permissions or modes of the specified file or directory. |
void |
changeOwner(int uid,
java.lang.String path)
Sets the user ID to owner for the file or directory. |
void |
chdir(java.lang.String dir)
Change the remote working directory to that supplied |
void |
connect()
Connects to the server at the address and port number defined in the constructor. |
boolean |
connected()
Is the client currently connected? |
void |
delete(java.lang.String remoteFile)
Delete the specified remote file |
java.lang.String[] |
dir()
List current directory's contents as an array of strings of filenames. |
java.lang.String[] |
dir(java.lang.String dirname)
List a directory's contents as an array of strings of filenames. |
java.lang.String[] |
dir(java.lang.String dirname,
boolean full)
List a directory's contents as an array of strings. |
FTPFile[] |
dirDetails(java.lang.String dirname)
List a directory's contents as an array of FTPFile objects. |
void |
dirDetails(java.lang.String dirname,
DirectoryListCallback lister)
List a directory's contents via a callback. |
boolean |
exists(java.lang.String remoteFile)
Does the named file exist in the current server directory? |
void |
get(java.io.OutputStream destStream,
java.lang.String remoteFile)
Get data from the FTP server. |
byte[] |
get(java.lang.String remoteFile)
Get data from the FTP server. |
void |
get(java.lang.String localPath,
java.lang.String remoteFile)
Download a file |
int |
getConfigFlags()
Get the set configuration flags. |
int |
getCountBeforeSleep()
Get the number of transfers set before sleeping |
java.lang.String |
getDetectedRemoteEOL()
Get the EOL detected by the client |
boolean |
getDetectTransferMode()
Get the detect transfer mode |
static SSHFTPPublicKey |
getHostPublicKey(java.lang.String remoteHost)
Helper method that may be used to obtain a server's public key without instantiating an SSHFTPClient. |
static SSHFTPPublicKey |
getHostPublicKey(java.lang.String remoteHost,
int remotePort)
Helper method that may be used to obtain a server's public key without instantiating an SSHFTPClient. |
int |
getMaxPacketSize()
Get the max packet size set |
int |
getMaxTransferRate()
Get the maximum bandwidth for transfers |
long |
getMonitorInterval()
Get the bytes transferred between each callback on the progress monitor |
FTPProgressMonitor |
getProgressMonitor()
Get the reference to the progress monitor |
FTPProgressMonitorEx |
getProgressMonitorEx()
Get reference to the transfer listener |
java.lang.String |
getRemoteEOL()
Get the remote EOL string that is forced to be used irrespective of what is detected from server information. |
long |
getServerResponseTimeout()
Deprecated. Use SCPClient.getTimeout() |
java.lang.String |
getSFTPSubsystemPath()
Returns the server-side path of the SFTP subsystem (default is null). |
int |
getSleepTime()
Get the number of seconds spent asleep |
int |
getTransferBufferSize()
Get the size of the buffers used in writing to and reading from the server |
FTPTransferType |
getType()
Get the current transfer type |
java.lang.String |
getUmask()
Get the current umask |
boolean |
isParallelMode()
Is the client in parallel write mode, which is the default |
boolean |
isSleepEnabled()
Is sleeping enabled? |
boolean |
isTransferCancelled()
Has the current transfer been cancelled? |
void |
keepAlive()
Tries to keep the current connection alive by sending an innocuous commmand to signal that the client is still active |
void |
mdelete(java.io.FileFilter filter)
Deletes all files matching the filter in the current remote directory only |
void |
mdelete(java.lang.String wildcard)
Deletes all files matching the wildcard in the current remote directory only |
void |
mdelete(java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
Delete all the files in this directory (and its subdirectories if recurse is true) that match the supplied filter. |
void |
mdelete(java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
Delete all the files in this directory (and its subdirectories if recurse is true) that match the supplied wildcard. |
void |
mget(java.lang.String localDir,
java.io.FileFilter filter)
Get all files matching the filter in the current remote directory only into the supplied local directory |
void |
mget(java.lang.String localDir,
java.lang.String wildcard)
Get all files matching the filter in the current remote directory only into the supplied local directory |
void |
mget(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
Gets this entire remote directory and its contents, recursively going through the remote directory name supplied. |
void |
mget(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
Gets this entire remote directory and its contents, recursively going through the remote directory name supplied. |
void |
mkdir(java.lang.String dir)
Create the specified remote working directory |
java.util.Date |
modtime(java.lang.String remoteFile)
Get modification time for a remote file. |
void |
mput(java.lang.String localDir,
java.io.FileFilter filter)
Put all files matching the wildcard in the supplied local directory only into the current remote directory |
void |
mput(java.lang.String localDir,
java.lang.String wildcard)
Put all files matching the wildcard in the supplied local directory only into the current remote directory |
void |
mput(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
Puts this entire directory and its contents. |
void |
mput(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
Puts this entire directory and its contents. |
java.lang.String |
put(byte[] bytes,
java.lang.String remoteFile)
Put data onto the FTP server. |
java.lang.String |
put(byte[] bytes,
java.lang.String remoteFile,
boolean append)
Put data onto the FTP server. |
java.lang.String |
put(java.io.InputStream srcStream,
java.lang.String remoteFile)
Put a stream of data onto the FTP server. |
java.lang.String |
put(java.io.InputStream srcStream,
java.lang.String remoteFile,
boolean append)
Put a stream of data onto the FTP server. |
java.lang.String |
put(java.lang.String localPath,
java.lang.String remoteFile)
Upload a file. |
java.lang.String |
put(java.lang.String localPath,
java.lang.String remoteFile,
boolean append)
Put a local file onto the FTP server. |
java.lang.String |
pwd()
Get the current remote working directory |
void |
quit()
Quit the FTP session |
void |
quitImmediately()
Quit the FTP session immediately. |
void |
rename(java.lang.String from,
java.lang.String to)
Rename a file or directory |
void |
resume()
Make the next file transfer (put or get) resume. |
void |
rmdir(java.lang.String dir)
Delete the specified remote working directory |
void |
rmdir(java.lang.String remoteDir,
boolean recurse)
Delete this remote directory. |
void |
setConfigFlags(int configFlags)
Set the configuration flags. |
void |
setControlEncoding(java.lang.String controlEncoding)
Set the encoding. |
void |
setCountBeforeSleep(int countBeforeSleep)
Set the number of transfers required before sleeping |
void |
setDetectTransferMode(boolean detectTransferMode)
Set autodetect of filetypes on or off. |
void |
setMaxPacketSize(int maxPacketSize)
Set the maximum packet size. |
void |
setMaxTransferRate(int thresholdBytesPerSecond)
Set the maximum transfer rates in bytes per sec |
void |
setModTime(java.lang.String path,
java.util.Date modTime)
Set the last modified time for the supplied file |
void |
setMonitorInterval(long interval)
Set the progress monitor interval for notifications |
void |
setParallelMode(boolean parallelWriteMode)
Switch parallel write mode on or off |
void |
setProgressMonitor(FTPProgressMonitor monitor)
Set a progress monitor for callbacks. |
void |
setProgressMonitor(FTPProgressMonitor monitor,
long interval)
Set a progress monitor for callbacks. |
void |
setProgressMonitorEx(FTPProgressMonitorEx monitorEx)
Set reference to the transfer listener |
void |
setRemoteEOL(java.lang.String remoteEOL)
Set a remoteEOL to be forced, irrespective of what is detected from server information |
void |
setServerResponseTimeout(long serverResponseTimeout)
Deprecated. Use setTimeout(int) |
void |
setSFTPSubsystemPath(java.lang.String sftpSubsystemPath)
Sets the server-side path of the SFTP subsystem (default is null). |
void |
setSleepEnabled(boolean sleepEnabled)
Set sleeping enabled to be on or off |
void |
setSleepTime(int sleepTime)
Set the time spent asleep |
void |
setTimeout(int millis)
Set the TCP timeout on the underlying socket(s). |
void |
setTransferBufferSize(int size)
Set the size of the buffers used in writing to and reading from the server |
void |
setType(FTPTransferType type)
Set the transfer type |
void |
setUmask(java.lang.String umask)
Sets the umask used to write permissions |
long |
size(java.lang.String remoteFile)
Get the size of a remote file. |
java.lang.String |
toString()
String representation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.enterprisedt.net.ftp.pro.ProFTPClientInterface |
|---|
getProxySettings |
| Methods inherited from interface com.enterprisedt.net.ftp.FTPClientInterface |
|---|
executeCommand, getDeleteCount, getDownloadCount, getId, getRemoteHost, getRemotePort, getTimeout, getUploadCount, resetDeleteCount, resetDownloadCount, resetUploadCount, setId, setRemoteHost, setRemotePort, system |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_ENCODING
public static final java.lang.String EOL_CRLF
public static final java.lang.String EOL_LF
| Constructor Detail |
|---|
public SSHFTPClient()
| Method Detail |
|---|
public void setConfigFlags(int configFlags)
throws FTPException
configFlags - configuration flags to set
FTPExceptionpublic int getConfigFlags()
public boolean isParallelMode()
public void setParallelMode(boolean parallelWriteMode)
parallelWriteMode - true for on, false for offpublic void setMaxTransferRate(int thresholdBytesPerSecond)
setMaxTransferRate in interface ProFTPClientInterfacethresholdBytesPerSecond - maximum bytes per second to transferpublic int getMaxTransferRate()
getMaxTransferRate in interface ProFTPClientInterfacepublic long getServerResponseTimeout()
SCPClient.getTimeout()
public void setServerResponseTimeout(long serverResponseTimeout)
throws FTPException
setTimeout(int)
serverResponseTimeout - server response timeout in milliseconds
FTPException
public void setControlEncoding(java.lang.String controlEncoding)
throws FTPException
setControlEncoding in interface FTPClientInterfacecontrolEncoding - The controlEncoding to set, which is the name of a Charset
FTPExceptionCharset
public static SSHFTPPublicKey getHostPublicKey(java.lang.String remoteHost)
throws FTPException
SSHFTPClient. This method returns an
SSHFTPPublicKey object whose SSHFTPPublicKey.write(OutputStream, int)
method may be used to write the public key to a file. The method will
return null if a public key could not be retrieved. Logging may
be used to discover any connection problems. If more advanced settings are
required then an instance of SSHFTPClient should be used.
remoteHost - Address of the server whose public key is to be fetched.
SSHFTPPublicKey representing
FTPException
public static SSHFTPPublicKey getHostPublicKey(java.lang.String remoteHost,
int remotePort)
throws FTPException
SSHFTPClient. This method returns an
SSHFTPPublicKey object SSHFTPPublicKey.write(OutputStream,int)
method may be used to write the public key to a file. The method will
return null if a public key could not be retrieved. Logging may
be used to discover any connection problems. If more advanced settings are
required then an instance of SSHFTPClient should be used.
remoteHost - Address of the server whose public key is to be fetched.remotePort - Port of the server whose public key is to be fetched.
SSHFTPPublicKey representing
FTPException
public void setTimeout(int millis)
throws FTPException
FTPClientInterface
setTimeout in interface FTPClientInterfacesetTimeout in class SCPClientmillis - The length of the timeout, in milliseconds
FTPExceptionpublic void setDetectTransferMode(boolean detectTransferMode)
FTPClientInterface
setDetectTransferMode in interface FTPClientInterfacedetectTransferMode - true if detecting transfer mode, false if notpublic boolean getDetectTransferMode()
FTPClientInterface
getDetectTransferMode in interface FTPClientInterfacepublic int getMaxPacketSize()
public void setMaxPacketSize(int maxPacketSize)
throws FTPException
maxPacketSize - size to set
FTPExceptionpublic void setTransferBufferSize(int size)
size - new size of buffer in bytespublic int getTransferBufferSize()
public void setRemoteEOL(java.lang.String remoteEOL)
remoteEOL - remoteEOL to forcepublic java.lang.String getRemoteEOL()
public FTPTransferType getType()
FTPClientInterface
getType in interface FTPClientInterfacepublic void setType(FTPTransferType type)
FTPClientInterface
setType in interface FTPClientInterfacetype - the transfer type to
set the server topublic java.lang.String getSFTPSubsystemPath()
null, which causes the sftp
subsystem to be used.
public void setSFTPSubsystemPath(java.lang.String sftpSubsystemPath)
null, which causes the sftp subsystem
to be used. Setting this property is equivalent to using the
-s option on the OpenSSH sftp console command.
sftpSubsystemPath - path of the SFTP subsystem on the server.
public void resume()
throws FTPException
FTPClientInterface
resume in interface FTPClientInterfaceFTPException
public void cancelResume()
throws java.io.IOException,
FTPException
FTPClientInterface
cancelResume in interface FTPClientInterfacejava.io.IOException
FTPExceptionpublic void cancelTransfer()
FTPClientInterface
cancelTransfer in interface FTPClientInterfacepublic boolean isTransferCancelled()
public void connect()
throws java.io.IOException,
FTPException
connect in interface FTPClientInterfaceconnect in class SCPClientjava.io.IOException - Thrown if there is a TCP/IP-related error.
FTPException - Thrown if client is already connected or if there is
a configuration error, or if a connection could not be established.public java.lang.String getDetectedRemoteEOL()
public boolean connected()
connected in interface FTPClientInterfaceconnected in class SCPClient
public void setProgressMonitor(FTPProgressMonitor monitor,
long interval)
FTPClientInterface
setProgressMonitor in interface FTPClientInterfacemonitor - the monitor objectinterval - bytes transferred in between callbackspublic void setProgressMonitor(FTPProgressMonitor monitor)
FTPClientInterface
setProgressMonitor in interface FTPClientInterfacemonitor - the monitor objectpublic long getMonitorInterval()
FTPClientInterface
getMonitorInterval in interface FTPClientInterfacepublic void setMonitorInterval(long interval)
setMonitorInterval in interface ProFTPClientInterfaceinterval - notification intervalpublic FTPProgressMonitor getProgressMonitor()
public FTPProgressMonitorEx getProgressMonitorEx()
getProgressMonitorEx in interface ProFTPClientInterfacepublic void setProgressMonitorEx(FTPProgressMonitorEx monitorEx)
setProgressMonitorEx in interface ProFTPClientInterfacemonitorEx - transfer listener
public long size(java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
size in interface FTPClientInterfaceremoteFile - name or path of remote file in current directory
java.io.IOException
FTPException
public java.lang.String put(java.lang.String localPath,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
SCPClient
put in interface FTPClientInterfaceput in class SCPClientlocalPath - path of local file to be uploadedremoteFile - path of remote file to upload to
java.io.IOException
FTPException
public java.lang.String put(java.lang.String localPath,
java.lang.String remoteFile,
boolean append)
throws java.io.IOException,
FTPException
FTPClientInterface
put in interface FTPClientInterfacelocalPath - path of the local fileremoteFile - name of remote file in current directory, or null if
a unique filename is to be generated by the serverappend - true if appending, false otherwise
java.io.IOException
FTPException
public java.lang.String put(java.io.InputStream srcStream,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
put in interface FTPClientInterfacesrcStream - input stream of data to putremoteFile - name of remote file in
current directory, or null if
a unique filename is to be generated by the server
java.io.IOException
FTPException
public java.lang.String put(java.io.InputStream srcStream,
java.lang.String remoteFile,
boolean append)
throws java.io.IOException,
FTPException
FTPClientInterface
put in interface FTPClientInterfacesrcStream - input stream of data to putremoteFile - name of remote file in
current directory, or null if
a unique filename is to be generated by the serverappend - true if appending, false otherwise
java.io.IOException
FTPException
public java.lang.String put(byte[] bytes,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
put in interface FTPClientInterfacebytes - array of bytesremoteFile - name of remote file in
current directory, or null if
a unique filename is to be generated by the server
java.io.IOException
FTPException
public java.lang.String put(byte[] bytes,
java.lang.String remoteFile,
boolean append)
throws java.io.IOException,
FTPException
FTPClientInterface
put in interface FTPClientInterfacebytes - array of bytesremoteFile - name of remote file in
current directory, or null if
a unique filename is to be generated by the serverappend - true if appending, false otherwise
java.io.IOException
FTPException
public void get(java.lang.String localPath,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
SCPClient
get in interface FTPClientInterfaceget in class SCPClientlocalPath - path of local file to download toremoteFile - path of remote file
java.io.IOException
FTPException
public void get(java.io.OutputStream destStream,
java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
get in interface FTPClientInterfacedestStream - data stream to write data toremoteFile - name of remote file in
current directory
java.io.IOException
FTPException
public byte[] get(java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
get in interface FTPClientInterfaceremoteFile - name of remote file in
current directory
java.io.IOException
FTPException
public void dirDetails(java.lang.String dirname,
DirectoryListCallback lister)
throws java.io.IOException,
FTPException,
java.text.ParseException
FTPClientInterface
dirDetails in interface FTPClientInterfacedirname - name of directory (some servers permit a filemask)lister - callback to be notified of errors
java.io.IOException
FTPException
java.text.ParseException
public FTPFile[] dirDetails(java.lang.String dirname)
throws java.io.IOException,
FTPException,
java.text.ParseException
FTPClientInterface
dirDetails in interface FTPClientInterfacedirname - name of directory (some servers permit a filemask)
java.io.IOException
FTPException
java.text.ParseException
public java.lang.String[] dir()
throws java.io.IOException,
FTPException
FTPClientInterface
dir in interface FTPClientInterfacejava.io.IOException
FTPException
public java.lang.String[] dir(java.lang.String dirname)
throws java.io.IOException,
FTPException
FTPClientInterface
dir in interface FTPClientInterfacedirname - name of directory OR filemask
java.io.IOException
FTPException
public java.lang.String[] dir(java.lang.String dirname,
boolean full)
throws java.io.IOException,
FTPException
FTPClientInterface
dir in interface FTPClientInterfacedirname - name of directory OR filemaskfull - true if detailed listing required
false otherwise
java.io.IOException
FTPException
public void delete(java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
delete in interface FTPClientInterfaceremoteFile - name of remote file to
delete
java.io.IOException
FTPException
public void rename(java.lang.String from,
java.lang.String to)
throws java.io.IOException,
FTPException
FTPClientInterface
rename in interface FTPClientInterfacefrom - name of file or directory to renameto - intended name
java.io.IOException
FTPException
public boolean exists(java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
exists in interface FTPClientInterfaceremoteFile - name of remote file
java.io.IOException
FTPException
public void rmdir(java.lang.String dir)
throws java.io.IOException,
FTPException
FTPClientInterface
rmdir in interface FTPClientInterfacedir - name of remote directory to
delete
java.io.IOException
FTPException
public void mkdir(java.lang.String dir)
throws java.io.IOException,
FTPException
FTPClientInterface
mkdir in interface FTPClientInterfacedir - name of remote directory to
create
java.io.IOException
FTPException
public void changeMode(int permissions,
java.lang.String path)
throws java.io.IOException,
FTPException
Absolute modes are octal numbers specifying the complete list of attributes for the files; you specify attributes by OR'ing together these bits. These must be octal numbers as in the examples below. 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/directory. These must be in octal, i.e.
they must be preceded with a '0'.path - the path to the file/directory on the remote server
java.io.IOException - if an IO error occurs or the file if not found
FTPException
public void changeMode(java.lang.String permissions,
java.lang.String path)
throws java.io.IOException,
FTPException
Absolute modes are octal numbers specifying the complete list of attributes for the files; you specify attributes by OR'ing together these bits. These must be octal strings as in the examples below. 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/directory. These must be an octal stringpath - the path to the file/directory on the remote server
java.io.IOException - if an IO error occurs or the file if not found
FTPException
public void changeGroup(int gid,
java.lang.String path)
throws java.io.IOException,
FTPException
gid - the numeric group id for the new grouppath - the path to the remote file/directory
java.io.IOException - if an IO error occurs or the file does not exist
FTPException
public void changeOwner(int uid,
java.lang.String path)
throws java.io.IOException,
FTPException
uid - numeric user id of the new ownerpath - the path to the remote file/directory
java.io.IOException - if an IO error occurs or the file does not exist
FTPException
public void setUmask(java.lang.String umask)
throws FTPException
umask - umask as 4 digit octal, e.g. 0022
FTPException
public java.lang.String getUmask()
throws FTPException
FTPException
public void chdir(java.lang.String dir)
throws java.io.IOException,
FTPException
FTPClientInterface
chdir in interface FTPClientInterfacedir - name of remote directory to
change to
java.io.IOException
FTPException
public void cdup()
throws java.io.IOException,
FTPException
FTPClientInterface
cdup in interface FTPClientInterfacejava.io.IOException
FTPException
public java.util.Date modtime(java.lang.String remoteFile)
throws java.io.IOException,
FTPException
FTPClientInterface
modtime in interface FTPClientInterfaceremoteFile - name of remote file
java.io.IOException
FTPException
public void setModTime(java.lang.String path,
java.util.Date modTime)
throws java.io.IOException,
FTPException
setModTime in interface FTPClientInterfacepath - the path to the file/directory on the remote servermodTime - the time stamp (UTC) of when it was last modified
java.io.IOException
FTPException
public java.lang.String pwd()
throws java.io.IOException,
FTPException
FTPClientInterface
pwd in interface FTPClientInterfacejava.io.IOException
FTPException
public void mdelete(java.lang.String wildcard)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfacejava.io.IOException
FTPException
java.text.ParseException
public void mdelete(java.io.FileFilter filter)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfacefilter - file filter
java.io.IOException
FTPException
java.text.ParseException
public void mdelete(java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfaceremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true, recurse through subdirectories
java.io.IOException
FTPException
java.text.ParseException
public void mdelete(java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mdelete in interface ProFTPClientInterfaceremoteDir - name of remote directoryfilter - filename filterrecurse - if true, recurse through subdirectories
java.io.IOException
FTPException
java.text.ParseException
public void rmdir(java.lang.String remoteDir,
boolean recurse)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
rmdir in interface ProFTPClientInterfaceremoteDir - name of remote directoryrecurse - if true, recurse through subdirectories
java.io.IOException
FTPException
java.text.ParseException
public void mput(java.lang.String localDir,
java.lang.String wildcard)
throws java.io.IOException,
FTPException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - local directory to get files fromwildcard - filename wildcard
java.io.IOException
FTPException
public void mput(java.lang.String localDir,
java.io.FileFilter filter)
throws java.io.IOException,
FTPException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - local directory to get files fromfilter - filename filter
java.io.IOException
FTPException
public void mput(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws FTPException,
java.io.IOException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - name of local directoryremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
public void mput(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws FTPException,
java.io.IOException
ProFTPClientInterface
mput in interface ProFTPClientInterfacelocalDir - name of local directoryremoteDir - name of remote directoryfilter - filename filterrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
public void mget(java.lang.String localDir,
java.lang.String wildcard)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - local directory to get files fromwildcard - filename wildcard
java.io.IOException
FTPException
java.text.ParseException
public void mget(java.lang.String localDir,
java.io.FileFilter filter)
throws java.io.IOException,
FTPException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - local directory to get files fromfilter - filename filter
java.io.IOException
FTPException
java.text.ParseException
public void mget(java.lang.String localDir,
java.lang.String remoteDir,
java.lang.String wildcard,
boolean recurse)
throws FTPException,
java.io.IOException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - name of local directory we are transferring intoremoteDir - name of remote directorywildcard - filename wildcardrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
java.text.ParseException
public void mget(java.lang.String localDir,
java.lang.String remoteDir,
java.io.FileFilter filter,
boolean recurse)
throws FTPException,
java.io.IOException,
java.text.ParseException
ProFTPClientInterface
mget in interface ProFTPClientInterfacelocalDir - name of local directory we are transferring intoremoteDir - name of remote directoryfilter - filename filterrecurse - if true recurse into subdirectories
FTPException
java.io.IOException
java.text.ParseExceptionpublic int getCountBeforeSleep()
ProFTPClientInterface
getCountBeforeSleep in interface ProFTPClientInterfacepublic void setCountBeforeSleep(int countBeforeSleep)
ProFTPClientInterface
setCountBeforeSleep in interface ProFTPClientInterfacecountBeforeSleep - maximum transfer countpublic boolean isSleepEnabled()
ProFTPClientInterface
isSleepEnabled in interface ProFTPClientInterfacepublic void setSleepEnabled(boolean sleepEnabled)
ProFTPClientInterface
setSleepEnabled in interface ProFTPClientInterfacesleepEnabled - if true, sleeping is enabled, otherwise it is switched offpublic int getSleepTime()
ProFTPClientInterface
getSleepTime in interface ProFTPClientInterfacepublic void setSleepTime(int sleepTime)
ProFTPClientInterface
setSleepTime in interface ProFTPClientInterfacesleepTime - sleep time in seconds
public void keepAlive()
throws java.io.IOException,
FTPException
keepAlive in interface FTPClientInterfacejava.io.IOException
FTPException
public void quit()
throws java.io.IOException,
FTPException
FTPClientInterface
quit in interface FTPClientInterfacequit in class SCPClientjava.io.IOException
FTPException
public void quitImmediately()
throws java.io.IOException,
FTPException
FTPClientInterface
quitImmediately in interface FTPClientInterfacequitImmediately in class SCPClientjava.io.IOException
FTPExceptionpublic java.lang.String toString()
toString in class SCPClient
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||