Class FTPFileSender
- java.lang.Object
-
- com.pixelmed.ftp.FTPFileSender
-
public class FTPFileSender extends java.lang.Object
A class to send files via FTP or secure FTP over TLS.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
socketConnectTimeoutInMilliSeconds
-
Constructor Summary
Constructors Constructor Description FTPFileSender(FTPRemoteHost remoteHost, java.lang.String[] files, boolean generateRandomRemoteFileNames, int debugLevel, MessageLogger logger, javax.swing.JProgressBar progressBar)
Construct an ftp connection to send a list of files to a remote server.FTPFileSender(FTPRemoteHost remoteHost, java.lang.String[] files, boolean generateRandomRemoteFileNames, MessageLogger logger, javax.swing.JProgressBar progressBar)
Construct an ftp connection to send a list of files to a remote server.FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames)
Construct an ftp connection to send a list of files to a remote server.FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames, int debugLevel)
Construct an ftp connection to send a list of files to a remote server.FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames, int debugLevel, MessageLogger logger, javax.swing.JProgressBar progressBar)
Construct an ftp connection to send a list of files to a remote server.FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames, MessageLogger logger, javax.swing.JProgressBar progressBar)
Construct an ftp connection to send a list of files to a remote server.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] arg)
-
-
-
Constructor Detail
-
FTPFileSender
public FTPFileSender(FTPRemoteHost remoteHost, java.lang.String[] files, boolean generateRandomRemoteFileNames, int debugLevel, MessageLogger logger, javax.swing.JProgressBar progressBar) throws java.security.NoSuchAlgorithmException, java.io.IOException, java.lang.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 hostfiles
- a String array of local filenames to sendgenerateRandomRemoteFileNames
- whether or not to generate random remote file names or to use the basename of the supplied local filenamedebugLevel
- ignoredlogger
- where to send routine logging messages (may be null)progressBar
- where to send progress updates (may be null)- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
java.lang.Exception
-
FTPFileSender
public FTPFileSender(FTPRemoteHost remoteHost, java.lang.String[] files, boolean generateRandomRemoteFileNames, MessageLogger logger, javax.swing.JProgressBar progressBar) throws java.security.NoSuchAlgorithmException, java.io.IOException, java.lang.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 hostfiles
- a String array of local filenames to sendgenerateRandomRemoteFileNames
- whether or not to generate random remote file names or to use the basename of the supplied local filenamelogger
- where to send routine logging messages (may be null)progressBar
- where to send progress updates (may be null)- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
java.lang.Exception
-
FTPFileSender
public FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames, int debugLevel) throws java.security.NoSuchAlgorithmException, java.io.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 serverusername
- the username for loginpassword
- the password for loginremoteDirectory
- 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 sendsecure
- whether or not to use secure ftp over tls, or ordinary ftpgenerateRandomRemoteFileNames
- whether or not to generate random remote file names or to use the basename of the supplied local filenamedebugLevel
- ignored- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FTPException
-
FTPFileSender
public FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames) throws java.security.NoSuchAlgorithmException, java.io.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 serverusername
- the username for loginpassword
- the password for loginremoteDirectory
- 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 sendsecure
- whether or not to use secure ftp over tls, or ordinary ftpgenerateRandomRemoteFileNames
- whether or not to generate random remote file names or to use the basename of the supplied local filename- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FTPException
-
FTPFileSender
public FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames, int debugLevel, MessageLogger logger, javax.swing.JProgressBar progressBar) throws java.security.NoSuchAlgorithmException, java.io.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 serverusername
- the username for loginpassword
- the password for loginremoteDirectory
- 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 sendsecure
- whether or not to use secure ftp over tls, or ordinary ftpgenerateRandomRemoteFileNames
- whether or not to generate random remote file names or to use the basename of the supplied local filenamedebugLevel
- ignoredlogger
- where to send routine logging messages (may be null)progressBar
- where to send progress updates (may be null)- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FTPException
-
FTPFileSender
public FTPFileSender(java.lang.String server, java.lang.String username, java.lang.String password, java.lang.String remoteDirectory, java.lang.String[] files, boolean secure, boolean generateRandomRemoteFileNames, MessageLogger logger, javax.swing.JProgressBar progressBar) throws java.security.NoSuchAlgorithmException, java.io.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 serverusername
- the username for loginpassword
- the password for loginremoteDirectory
- 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 sendsecure
- whether or not to use secure ftp over tls, or ordinary ftpgenerateRandomRemoteFileNames
- whether or not to generate random remote file names or to use the basename of the supplied local filenamelogger
- where to send routine logging messages (may be null)progressBar
- where to send progress updates (may be null)- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
FTPException
-
-