Interface IFTPClient

All Superinterfaces:
com.netlang.io.filesystem.FileSystem
All Known Implementing Classes:
NFTPClient, NSFTPClient

public interface IFTPClient extends com.netlang.io.filesystem.FileSystem
Interface for a FTP Connection. The implementing client may use different protocols for communication, SSH, Odette..
  • Field Details

  • Method Details

    • list

      List<NLFile> list(String path, String pattern, int type) throws Exception
      List all directories that matches the specified pattern.
      Parameters:
      path - the path
      pattern - the pattern
      Returns:
      Throws:
      Exception
    • createFolder

      void createFolder(String directory) throws Exception
      Creates a new directory at the FTP server in the current location
      Parameters:
      directory -
      Throws:
      Exception
    • changeDir

      boolean changeDir(String directory) throws Exception
      Change the current working directory.
      Parameters:
      directory - the new directory
      Returns:
      true if successfully
      Throws:
      Exception
    • getFile

      InputStream getFile(String file) throws Exception
      Returns a InputStream for the specified file.
      Parameters:
      file - the file at the FTP server
      Returns:
      the content as an inputStream
      Throws:
      Exception
    • transferFile

      void transferFile(String remotefile, String toLocalFile) throws Exception
      Download a file from the FTP server to a local folder.
      Parameters:
      remotefile - the remote file
      toLocalFile - the local folder
      Throws:
      Exception
    • transferFile

      void transferFile(String remotefile, String toLocalFolder, String toLocalFile) throws Exception
      Throws:
      Exception
    • putFile

      void putFile(String localfile, String destinationFile) throws Exception
      Uploads a file to the FTP server
      Parameters:
      localfile -
      destinationFile -
      Throws:
      Exception
    • removeFile

      void removeFile(String file) throws Exception
      Delete the specified file on the remote server.
      Parameters:
      path - the file
      Throws:
      Exception
    • sendCommand

      String sendCommand(String command, String args) throws Exception
      Send a RAW FTP command to the server.
      Parameters:
      command - the command
      args - the arguments
      Returns:
      the respone from the FTP server
      Throws:
      Exception
    • getFileSize

      long getFileSize(String filename) throws Exception
      Returns the size of the specified file.
      Parameters:
      filename - the file on the FTP server
      Returns:
      the size in bytes
      Throws:
      Exception
    • close

      void close() throws Exception
      Closes this connection
      Throws:
      Exception
    • put

      void put(NetlangFile from, String path, FileOptions options) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • put

      void put(File from, String path, FileOptions options) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • put

      void put(String from, String path, FileOptions options) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • put

      void put(String fromResourceId, String frompath, String remotePath, FileOptions options) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • get

      void get(String path, NetlangFile to) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • get

      void get(String path, String to) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • get

      void get(String path, File to) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • get

      void get(String remotePath, String toResourceId, String toFile) throws com.net4z.APIException
      Throws:
      com.net4z.APIException