Class FTPFileSender

java.lang.Object
com.pixelmed.ftp.FTPFileSender

public class FTPFileSender extends Object

A class to send files via FTP or secure FTP over TLS.

  • Field Details

    • socketConnectTimeoutInMilliSeconds

      protected static int socketConnectTimeoutInMilliSeconds
  • Constructor Details

    • FTPFileSender

      public FTPFileSender(FTPRemoteHost remoteHost, String[] files, boolean generateRandomRemoteFileNames, int debugLevel, MessageLogger logger, JProgressBar progressBar) throws NoSuchAlgorithmException, IOException, Exception

      Construct an ftp connection to send a list of files to a remote server.

      Sends a list of files to a single remote directory. Note that if the supplied local file names have the same base name (same name in different local directories) then they wil overwrite each other in the single remote directory; hence the option to generate random remote names.

      Parameters:
      remoteHost - the characteristics of the remote host
      files - a String array of local filenames to send
      generateRandomRemoteFileNames - whether or not to generate random remote file names or to use the basename of the supplied local filename
      debugLevel - ignored
      logger - where to send routine logging messages (may be null)
      progressBar - where to send progress updates (may be null)
      Throws:
      NoSuchAlgorithmException
      IOException
      Exception
    • FTPFileSender

      public FTPFileSender(FTPRemoteHost remoteHost, String[] files, boolean generateRandomRemoteFileNames, MessageLogger logger, JProgressBar progressBar) throws NoSuchAlgorithmException, IOException, Exception

      Construct an ftp connection to send a list of files to a remote server.

      Sends a list of files to a single remote directory. Note that if the supplied local file names have the same base name (same name in different local directories) then they wil overwrite each other in the single remote directory; hence the option to generate random remote names.

      Parameters:
      remoteHost - the characteristics of the remote host
      files - a String array of local filenames to send
      generateRandomRemoteFileNames - whether or not to generate random remote file names or to use the basename of the supplied local filename
      logger - where to send routine logging messages (may be null)
      progressBar - where to send progress updates (may be null)
      Throws:
      NoSuchAlgorithmException
      IOException
      Exception
    • FTPFileSender

      public FTPFileSender(String server, String username, String password, String remoteDirectory, String[] files, boolean secure, boolean generateRandomRemoteFileNames, int debugLevel) throws NoSuchAlgorithmException, IOException, FTPException

      Construct an ftp connection to send a list of files to a remote server.

      Sends a list of files to a single remote directory. Note that if the supplied local file names have the same base name (same name in different local directories) then they wil overwrite each other in the single remote directory; hence the option to generate random remote names.

      Parameters:
      server - the hostname or IP address of the server
      username - the username for login
      password - the password for login
      remoteDirectory - the remote directory to upload the files to (may be null if the root directory is to be used)
      files - a String array of local filenames to send
      secure - whether or not to use secure ftp over tls, or ordinary ftp
      generateRandomRemoteFileNames - whether or not to generate random remote file names or to use the basename of the supplied local filename
      debugLevel - ignored
      Throws:
      NoSuchAlgorithmException
      IOException
      FTPException
    • FTPFileSender

      public FTPFileSender(String server, String username, String password, String remoteDirectory, String[] files, boolean secure, boolean generateRandomRemoteFileNames) throws NoSuchAlgorithmException, IOException, FTPException

      Construct an ftp connection to send a list of files to a remote server.

      Sends a list of files to a single remote directory. Note that if the supplied local file names have the same base name (same name in different local directories) then they wil overwrite each other in the single remote directory; hence the option to generate random remote names.

      Parameters:
      server - the hostname or IP address of the server
      username - the username for login
      password - the password for login
      remoteDirectory - the remote directory to upload the files to (may be null if the root directory is to be used)
      files - a String array of local filenames to send
      secure - whether or not to use secure ftp over tls, or ordinary ftp
      generateRandomRemoteFileNames - whether or not to generate random remote file names or to use the basename of the supplied local filename
      Throws:
      NoSuchAlgorithmException
      IOException
      FTPException
    • FTPFileSender

      public FTPFileSender(String server, String username, String password, String remoteDirectory, String[] files, boolean secure, boolean generateRandomRemoteFileNames, int debugLevel, MessageLogger logger, JProgressBar progressBar) throws NoSuchAlgorithmException, IOException, FTPException

      Construct an ftp connection to send a list of files to a remote server.

      Sends a list of files to a single remote directory. Note that if the supplied local file names have the same base name (same name in different local directories) then they wil overwrite each other in the single remote directory; hence the option to generate random remote names.

      Parameters:
      server - the hostname or IP address of the server
      username - the username for login
      password - the password for login
      remoteDirectory - the remote directory to upload the files to (may be null if the root directory is to be used)
      files - a String array of local filenames to send
      secure - whether or not to use secure ftp over tls, or ordinary ftp
      generateRandomRemoteFileNames - whether or not to generate random remote file names or to use the basename of the supplied local filename
      debugLevel - ignored
      logger - where to send routine logging messages (may be null)
      progressBar - where to send progress updates (may be null)
      Throws:
      NoSuchAlgorithmException
      IOException
      FTPException
    • FTPFileSender

      public FTPFileSender(String server, String username, String password, String remoteDirectory, String[] files, boolean secure, boolean generateRandomRemoteFileNames, MessageLogger logger, JProgressBar progressBar) throws NoSuchAlgorithmException, IOException, FTPException

      Construct an ftp connection to send a list of files to a remote server.

      Sends a list of files to a single remote directory. Note that if the supplied local file names have the same base name (same name in different local directories) then they wil overwrite each other in the single remote directory; hence the option to generate random remote names.

      Parameters:
      server - the hostname or IP address of the server
      username - the username for login
      password - the password for login
      remoteDirectory - the remote directory to upload the files to (may be null if the root directory is to be used)
      files - a String array of local filenames to send
      secure - whether or not to use secure ftp over tls, or ordinary ftp
      generateRandomRemoteFileNames - whether or not to generate random remote file names or to use the basename of the supplied local filename
      logger - where to send routine logging messages (may be null)
      progressBar - where to send progress updates (may be null)
      Throws:
      NoSuchAlgorithmException
      IOException
      FTPException
  • Method Details

    • main

      public static void main(String[] arg)