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

## com.mindbright.net.ftp
Interface FTPServerEventHandler

All Known Implementing Classes:
  SSH2FTPOverSFTP

public interface FTPServerEventHandler

Interface which describes FTP protocol functions.

Method Summary
`void` | `abort()`
`void` | `changeDirectory(java.lang.String dir)` Change current directory on the server.
`void` | `chmod(int mod, java.lang.String file)` Modify the file permissions.
`void` | `delete(java.lang.String file)` Delete the given file.
`boolean` | `isPlainFile(java.lang.String file)` Check if the name refers to a normal file as opposed to for example a directory.
`void` | `list(java.lang.String path, java.io.OutputStream data)` Lists the names of the files and directories in the given directory.
`boolean` | `login(java.lang.String user, java.lang.String pass)` Login to server.
`void` | `mkdir(java.lang.String dir)` Create a new directory.
`long` | `modTime(java.lang.String file)` Find out when a file was last modified.
`void` | `nameList(java.lang.String path, java.io.OutputStream data)` Lists the contents of the given directory.
`java.lang.String` | `pwd()` Get the current working directory.
`void` | `quit()` Close the ftp session.
`void` | `renameFrom(java.lang.String from)` The first step in a rename operation.
`void` | `renameTo(java.lang.String to)` The second step in the rename operation.
`void` | `retrieve(java.lang.String file, java.io.OutputStream data, boolean binary)` Retrieve a file from the server.
`void` | `rmdir(java.lang.String dir)` Remove the given directory.
`long` | `size(java.lang.String file)` Get the size of a file.
`void` | `store(java.lang.String file, java.io.InputStream data, boolean binary)` Store a file on the server.
`java.lang.String` | `system()` Get the type of system the server is running.

Method Detail

### login

    public boolean login(java.lang.String user,
                         java.lang.String pass)

  Login to server.

  Parameters:
    `user` - Username to login as.
    `pass` - Password.
  Returns:
    Returns true if the login was successful.

### quit

    public void quit()

  Close the ftp session.

### isPlainFile

    public boolean isPlainFile(java.lang.String file)

  Check if the name refers to a normal file as opposed to for example a directory.

  Parameters:
    `file` - The name of the file.
  Returns:
    True if the name refers to a plain file.

### changeDirectory

    public void changeDirectory(java.lang.String dir)
                         throws FTPException

  Change current directory on the server.

  Parameters:
    `dir` - Name of new directory
  Throws:
    `FTPException`

### renameFrom

    public void renameFrom(java.lang.String from)
                    throws FTPException

  The first step in a rename operation. Specifies which file to rename. Must be folloed by a call to `renameTo`.

  Parameters:
    `from` - The name of the file to rename.
  Throws:
    `FTPException`

### renameTo

    public void renameTo(java.lang.String to)
                  throws FTPException

  The second step in the rename operation. Specifies the new name of the file. Must be preceeded by a call to `renameFrom`

  Parameters:
    `to` - The new name of the file.
  Throws:
    `FTPException`

### delete

    public void delete(java.lang.String file)
                throws FTPException

  Delete the given file.

  Parameters:
    `file` - Name of the file to delete.
  Throws:
    `FTPException`

### rmdir

    public void rmdir(java.lang.String dir)
               throws FTPException

  Remove the given directory.

  Parameters:
    `dir` - Directory to remove.
  Throws:
    `FTPException`

### mkdir

    public void mkdir(java.lang.String dir)
               throws FTPException

  Create a new directory.

  Parameters:
    `dir` - Name of directory to create.
  Throws:
    `FTPException`

### chmod

    public void chmod(int mod,
                      java.lang.String file)
               throws FTPException

  Modify the file permissions.

  Parameters:
    `mod` - New file permissions.
    `file` - Name of file to modify.
  Throws:
    `FTPException`

### pwd

    public java.lang.String pwd()

  Get the current working directory.

  Returns:
    The path to the current working directory.

### system

    public java.lang.String system()

  Get the type of system the server is running.

  Returns:
    A string describing the system.

### modTime

    public long modTime(java.lang.String file)
                 throws FTPException

  Find out when a file was last modified.

  Parameters:
    `file` - Name of file to investigate.
  Returns:
    The timestamp of the file.
  Throws:
    `FTPException`

### size

    public long size(java.lang.String file)
              throws FTPException

  Get the size of a file.

  Parameters:
    `file` - Name of file to get the size of.
  Returns:
    The size of the file.
  Throws:
    `FTPException`

### store

    public void store(java.lang.String file,
                      java.io.InputStream data,
                      boolean binary)
               throws FTPException

  Store a file on the server. Line endings are translated into the proper form for non-binary files.

  Parameters:
    `file` - Name to store file as.
    `data` - Stream from which the contents of the file is read.
    `binary` - Controls the translating of line endings.
  Throws:
    `FTPException`

### retrieve

    public void retrieve(java.lang.String file,
                         java.io.OutputStream data,
                         boolean binary)
                  throws FTPException

  Retrieve a file from the server. Line endings are translated into the proper form for non-binary files.

  Parameters:
    `file` - Name of file to retrieve.
    `data` - Stream to which the file content is written.
    `binary` - Controls the translating of line endings.
  Throws:
    `FTPException`

### list

    public void list(java.lang.String path,
                     java.io.OutputStream data)
              throws FTPException

  Lists the names of the files and directories in the given directory. The difference between this function and `nameList` is that the latter appends a trailing '/' to directory names.

  Parameters:
    `path` - Directory to list the contens of.
    `data` - Stream to write the results to.
  Throws:
    `FTPException`

### nameList

    public void nameList(java.lang.String path,
                         java.io.OutputStream data)
                  throws FTPException

  Lists the contents of the given directory. The difference between this function and `list` is that the this appends a trailing '/' to directory names.

  Parameters:
    `path` - Directory to list the contens of.
    `data` - Stream to write the results to.
  Throws:
    `FTPException`

### abort

    public void abort()

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