|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface FTPHandler
This interface provides the generic FTP connections and operations. Users can provide customized FTP-client handler to implement this interface. Fill the fully-qualified class name of the customized class into the "Handler Class" on the "Schedule->Publish->To FTP" page and add the class into the class path of JReport Server.
| Field Summary | |
|---|---|
static int |
FTP
Scheme type FTP. |
static int |
FTPS
Scheme type FTPS. |
static java.lang.String[] |
SCHEMES
Contains the schemes "FTP", "SFTP", "SCP", "FTPS", "FTP", "Unknown". |
static int |
SCP
Scheme type SCP. |
static int |
SFTP
Scheme type SFPT. |
| Method Summary | |
|---|---|
boolean |
changeDirectory(java.lang.String dirName)
Changes the current working directory to another directory specified by dirName
on the remote FTP site. |
void |
connect(java.lang.String hostName)
Connects to the remote FTP site using the specified host and default FTP port. |
void |
connect(java.lang.String hostName,
int port)
Connects to the remote FTP site using the specified host and port. |
boolean |
deleteFile(java.lang.String fileName)
Deletes a file specified by the fileName on the remote FTP site. |
void |
disconnect()
Disconnects from the remote FTP site for terminating the connection. |
boolean |
downloadFile(java.lang.String fileName)
DownLoads a file specified by the fileName from the remote FTP site,
and saves it as the same fileName under the current path. |
boolean |
downloadFile(java.lang.String fileName,
java.lang.String localPath)
DownLoads a file specified by the fileName from the remote FTP site,
and saves it as the same fileName under the specified localPath. |
boolean |
downloadFile(java.lang.String remoteFileName,
java.lang.String localPath,
java.lang.String localFileName)
DownLoads a file specified by the remoteFileName from the remote FTP site,
and names it as localFileName under the specified localPath. |
java.lang.String |
getCurrentDirectory()
Gets the current working directory on the remote FTP site. |
java.lang.String |
getScheme()
Gets the protocol type of current connection. |
boolean |
login(java.lang.String userName,
java.lang.String password)
Logins to the remote FTP site with the specified userName and password. |
boolean |
login(java.lang.String userName,
java.lang.String password,
java.lang.String account)
Logs in to the remote FTP site using the specified userName, password
and account if there is. |
boolean |
logout()
Logs out from the remote FTP site for terminating the session. |
boolean |
makeDirectory(java.lang.String dirName)
Creates a new directory using the specified dirName under the current working directory
on the remote FTP site. |
boolean |
parentDirectory()
Changes the current working directory to the parent directory on the remote FTP site. |
void |
setConnectTimeout(int timeout)
Sets the connecting timeout on the connection. |
void |
setReadTimeout(int timeout)
Sets the read timeout on the connection. |
boolean |
uploadFile(java.lang.String fileName)
Uploads a local file specified by the fileName under the current directory
to the remote FTP site, and names it as the same fileName. |
boolean |
uploadFile(java.lang.String localPath,
java.lang.String fileName)
Uploads a local file specified by the fileName under the specified localPath
to the remote FTP site, and names it as the same fileName. |
boolean |
uploadFile(java.lang.String localPath,
java.lang.String localFileName,
java.lang.String remoteFileName)
Uploads a local file specified by the localFileName under the specified localPath
to the remote FTP site, and names it as remoteFileName. |
| Field Detail |
|---|
static final java.lang.String[] SCHEMES
"FTP", "SFTP", "SCP", "FTPS", "FTP", "Unknown".
static final int FTP
static final int SFTP
static final int SCP
static final int FTPS
| Method Detail |
|---|
boolean uploadFile(java.lang.String fileName)
throws java.io.IOException
fileName under the current directory
to the remote FTP site, and names it as the same fileName.
java.io.IOException
boolean uploadFile(java.lang.String localPath,
java.lang.String fileName)
throws java.io.IOException
fileName under the specified localPath
to the remote FTP site, and names it as the same fileName.
java.io.IOException
boolean uploadFile(java.lang.String localPath,
java.lang.String localFileName,
java.lang.String remoteFileName)
throws java.io.IOException
localFileName under the specified localPath
to the remote FTP site, and names it as remoteFileName.
java.io.IOException
boolean downloadFile(java.lang.String fileName)
throws java.io.IOException
fileName from the remote FTP site,
and saves it as the same fileName under the current path.
java.io.IOException
boolean downloadFile(java.lang.String fileName,
java.lang.String localPath)
throws java.io.IOException
fileName from the remote FTP site,
and saves it as the same fileName under the specified localPath.
java.io.IOException
boolean downloadFile(java.lang.String remoteFileName,
java.lang.String localPath,
java.lang.String localFileName)
throws java.io.IOException
remoteFileName from the remote FTP site,
and names it as localFileName under the specified localPath.
java.io.IOException
boolean deleteFile(java.lang.String fileName)
throws java.io.IOException
fileName on the remote FTP site.
java.io.IOException
boolean makeDirectory(java.lang.String dirName)
throws java.io.IOException
dirName under the current working directory
on the remote FTP site.
java.io.IOException
boolean changeDirectory(java.lang.String dirName)
throws java.io.IOException
dirName
on the remote FTP site.
java.io.IOException
boolean parentDirectory()
throws java.io.IOException
java.io.IOException
java.lang.String getCurrentDirectory()
throws java.io.IOException
java.io.IOException
void connect(java.lang.String hostName)
throws java.io.IOException
host and default FTP port.
java.io.IOException
void connect(java.lang.String hostName,
int port)
throws java.io.IOException
host and port.
java.io.IOException
boolean login(java.lang.String userName,
java.lang.String password)
throws java.io.IOException
userName and password.
java.io.IOException
boolean login(java.lang.String userName,
java.lang.String password,
java.lang.String account)
throws java.io.IOException
userName, password
and account if there is.
java.io.IOException
boolean logout()
throws java.io.IOException
java.io.IOException
void disconnect()
throws java.io.IOException
java.io.IOExceptionvoid setReadTimeout(int timeout)
void setConnectTimeout(int timeout)
java.lang.String getScheme()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||