Interface FtpSupportIntf

All Known Implementing Classes:
FtpSession, SftpSession

public interface FtpSupportIntf
Use this interface in classes that you would like to support, or contain support for, FTP.
  • Method Details

    • login

      boolean login(String ip, String login, String password) throws IOException
      Logs into the remote host, using the given ip address, login name and password.

      Parameters:
      ip - remote ip address
      login - login name
      password - login password

      Returns:
      true, if login is successful. false, otherwise.
      Throws:
      IOException
    • logout

      boolean logout() throws IOException
      Logs out of the remote FTP server
      Throws:
      IOException
    • disconnect

      void disconnect() throws IOException
      Disconnects from the remote FTP server
      Throws:
      IOException
    • setBinaryFileType

      void setBinaryFileType()
      Sets the transfer file type to BINARY
    • setAsciiFileType

      void setAsciiFileType()
      Sets the transfer file type to ASCII
    • get

      boolean get(String localFile, String remoteFile) throws IOException
      Copy the remote file to the local file. One must set the appropriate file type before the get; the default is binary mode.

      Parameters:
      localFile - Local file name.
      remoteFile - Remote file name.

      Returns:
      true, if get was successful.
      Throws:
      IOException
    • put

      boolean put(String localFile, String remoteFile) throws IOException
      Copy the local file to the remote file. One must set the appropriate file type before the get; the default is binary mode.

      Parameters:
      localFile - Local file name.
      remoteFile - Remote file name.

      Returns:
      true, if get was successful.
      Throws:
      IOException
    • delete

      boolean delete(String fileName) throws IOException
      Remove a file from the remote host.
      Parameters:
      fileName - remote file pathname
      Returns:
      true, if delete was successful
      Throws:
      IOException
    • pwd

      String pwd() throws IOException
      Returns the present working directory.
      Returns:
      present working directory
      Throws:
      IOException
    • cd

      boolean cd(String remotePath) throws IOException
      Changes the current working directory.
      Parameters:
      remotePath - new remote directory
      Returns:
      present working directory
      Throws:
      IOException
    • listFiles

      String[] listFiles() throws IOException
      Returns the list of files in the current remote directory.
      Returns:
      list of files
      Throws:
      IOException
    • listFiles

      String[] listFiles(String remotePath) throws IOException
      Returns the list of files in the given remote directory.
      Parameters:
      remotePath - remote directory to list
      Returns:
      list of files
      Throws:
      IOException
    • listDirectories

      String[] listDirectories(String remotePath) throws IOException
      Returns the list of directories in the given remote directory.
      Parameters:
      remotePath - remote directory to list
      Returns:
      list of directories
      Throws:
      IOException
    • getTimestamp

      Date getTimestamp(String remotePath) throws IOException
      Returns the timestamp of the given remote path.
      Parameters:
      remotePath - remote path for which to get timestamp
      Returns:
      timestamp of the remote path
      Throws:
      IOException
    • rename

      boolean rename(String from, String to) throws IOException
      Throws:
      IOException
    • getPassword

      String getPassword()
      Returns the login password
      Returns:
      login password
    • getHost

      String getHost()
      Returns the remote host
      Returns:
      remote host name
    • getLogin

      String getLogin()
      Returns the login name
      Returns:
      login name