Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jet.server.api.custom.ftp
Interface FTPHandler

    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-quilified classname of the customized class into the "Handler Class" on the "Schedule->Publish->To FTP" page and add the class into the classpath of JReport Server.

Field Summary
`static int` | `FTP`
`static int` | `FTPS`
`static java.lang.String[]` | `SCHEMES`
`static int` | `SCP`
`static int` | `SFTP`

Method Summary
`boolean` | `changeDirectory(java.lang.String dirName)` change the current working directory to another directory specified by `dirName` on the remote FTP site.
`void` | `connect(java.lang.String hostName)` connect to the remote FTP site with the specified `host` and default FTP port.
`void` | `connect(java.lang.String hostName, int port)` connect to the remote FTP site with the specified `host` and `port`.
`boolean` | `deleteFile(java.lang.String fileName)` delete a file specified by the `fileName` on the remote FTP site.
`void` | `disconnect()` disconnect from the remote FTP site for terminating the connection.
`boolean` | `downloadFile(java.lang.String fileName)` download a file specified by the `fileName` from the remote FTP site, and saved as the same `fileName` under the current path.
`boolean` | `downloadFile(java.lang.String fileName, java.lang.String localPath)` download a file specified by the `fileName` from the remote FTP site, and saved as the same `fileName` under the specified `localPath`.
`boolean` | `downloadFile(java.lang.String remoteFileName, java.lang.String localPath, java.lang.String localFileName)` download a file specified by the `remoteFileName` from the remote FTP site, and named as `localFileName` under the specified `localPath`.
`java.lang.String` | `getCurrentDirectory()` get the current working directory on the remote FTP site.
`java.lang.String` | `getScheme()` get the protocol type of current connection.
`boolean` | `login(java.lang.String userName, java.lang.String password)` login 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)` login to the remote FTP site with the specified `userName`, `password` and `account` if there.
`boolean` | `logout()` logout from the remote FTP site for terminating the session.
`boolean` | `makeDirectory(java.lang.String dirName)` create a new directory with the specified `dirName` under the current working directory on the remote FTP site.
`boolean` | `parentDirectory()` change the current working directory to the parent directory on the remote FTP site.
`void` | `setConnectTimeout(int timeout)` set the connect timeout on the connection.
`void` | `setReadTimeout(int timeout)` set the read timeout on the connection.
`boolean` | `uploadFile(java.lang.String fileName)` upload a local file specified by the `fileName` under the current directory to the remote FTP site, and named as the same `fileName`.
`boolean` | `uploadFile(java.lang.String localPath, java.lang.String fileName)` upload a local file specified by the `fileName` under the specified `localPath` to the remote FTP site, and named as the same `fileName`.
`boolean` | `uploadFile(java.lang.String localPath, java.lang.String localFileName, java.lang.String remoteFileName)` upload a local file specified by the `localFileName` under the specified `localPath` to the remote FTP site, and named as `remoteFileName`.

Field Detail

### SCHEMES

    static final java.lang.String[] SCHEMES

### FTP

    static final int FTP

See Also:
  Constant Field Values

### SFTP

    static final int SFTP

See Also:
  Constant Field Values

### SCP

    static final int SCP

See Also:
  Constant Field Values

### FTPS

    static final int FTPS

See Also:
  Constant Field Values

Method Detail

### uploadFile

    boolean uploadFile(java.lang.String fileName)
                       throws java.io.IOException

  upload a local file specified by the `fileName` under the current directory to the remote FTP site, and named as the same `fileName`.

  Throws:
    `java.io.IOException`

### uploadFile

    boolean uploadFile(java.lang.String localPath,
                       java.lang.String fileName)
                       throws java.io.IOException

  upload a local file specified by the `fileName` under the specified `localPath` to the remote FTP site, and named as the same `fileName`.

  Throws:
    `java.io.IOException`

### uploadFile

    boolean uploadFile(java.lang.String localPath,
                       java.lang.String localFileName,
                       java.lang.String remoteFileName)
                       throws java.io.IOException

  upload a local file specified by the `localFileName` under the specified `localPath` to the remote FTP site, and named as `remoteFileName`.

  Throws:
    `java.io.IOException`

### downloadFile

    boolean downloadFile(java.lang.String fileName)
                         throws java.io.IOException

  download a file specified by the `fileName` from the remote FTP site, and saved as the same `fileName` under the current path.

  Throws:
    `java.io.IOException`

### downloadFile

    boolean downloadFile(java.lang.String fileName,
                         java.lang.String localPath)
                         throws java.io.IOException

  download a file specified by the `fileName` from the remote FTP site, and saved as the same `fileName` under the specified `localPath`.

  Throws:
    `java.io.IOException`

### downloadFile

    boolean downloadFile(java.lang.String remoteFileName,
                         java.lang.String localPath,
                         java.lang.String localFileName)
                         throws java.io.IOException

  download a file specified by the `remoteFileName` from the remote FTP site, and named as `localFileName` under the specified `localPath`.

  Throws:
    `java.io.IOException`

### deleteFile

    boolean deleteFile(java.lang.String fileName)
                       throws java.io.IOException

  delete a file specified by the `fileName` on the remote FTP site.

  Throws:
    `java.io.IOException`

### makeDirectory

    boolean makeDirectory(java.lang.String dirName)
                          throws java.io.IOException

  create a new directory with the specified `dirName` under the current working directory on the remote FTP site.

  Throws:
    `java.io.IOException`

### changeDirectory

    boolean changeDirectory(java.lang.String dirName)
                            throws java.io.IOException

  change the current working directory to another directory specified by `dirName` on the remote FTP site.

  Throws:
    `java.io.IOException`

### parentDirectory

    boolean parentDirectory()
                            throws java.io.IOException

  change the current working directory to the parent directory on the remote FTP site.

  Throws:
    `java.io.IOException`

### getCurrentDirectory

    java.lang.String getCurrentDirectory()
                                         throws java.io.IOException

  get the current working directory on the remote FTP site.

  Throws:
    `java.io.IOException`

### connect

    void connect(java.lang.String hostName)
                 throws java.io.IOException

  connect to the remote FTP site with the specified `host` and default FTP port.

  Throws:
    `java.io.IOException`

### connect

    void connect(java.lang.String hostName,
                 int port)
                 throws java.io.IOException

  connect to the remote FTP site with the specified `host` and `port`.

  Throws:
    `java.io.IOException`

### login

    boolean login(java.lang.String userName,
                  java.lang.String password)
                  throws java.io.IOException

  login to the remote FTP site with the specified `userName` and `password`.

  Throws:
    `java.io.IOException`

### login

    boolean login(java.lang.String userName,
                  java.lang.String password,
                  java.lang.String account)
                  throws java.io.IOException

  login to the remote FTP site with the specified `userName`, `password` and `account` if there.

  Throws:
    `java.io.IOException`

### logout

    boolean logout()
                   throws java.io.IOException

  logout from the remote FTP site for terminating the session.

  Throws:
    `java.io.IOException`

### disconnect

    void disconnect()
                    throws java.io.IOException

  disconnect from the remote FTP site for terminating the connection.

  Throws:
    `java.io.IOException`

### setReadTimeout

    void setReadTimeout(int timeout)

  set the read timeout on the connection.

### setConnectTimeout

    void setConnectTimeout(int timeout)

  set the connect timeout on the connection.

### getScheme

    java.lang.String getScheme()

  get the protocol type of current connection.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD