Class FTPRemoteHostInformation
- java.lang.Object
-
- com.pixelmed.ftp.FTPRemoteHostInformation
-
public class FTPRemoteHostInformation extends java.lang.ObjectThis class encapsulates information about remote FTP servers.
The following properties are supported:
Ftp.RemoteHosts- a space or comma separated list of the local names all the available remote hosts; each local name may be anything unique (in this file) without a space or comma; the local name does not need to be the same as the remote host's nameFtp.XXXX.HostNameOrIPAddress- for the remote host with local name XXXX, what host or IP addess that AE will listen on for incoming connectionsFtp.XXXX.User- for the remote host with local name XXXX, what user name to login withFtp.XXXX.Password- for the remote host with local name XXXX, what password to login withFtp.XXXX.Directory- for the remote host with local name XXXX, what initial working directory to change toFtp.XXXX.Security- for the remote host with local name XXXX, what the type of security to use (supported values are NONE, TLS)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.TreeMap<java.lang.String,FTPRemoteHost>localNameToRemoteHostMapprotected static java.lang.StringpropertyDelimitersForTokenizer_FtpRemoteAEsstatic java.lang.StringpropertyName_FtpRemoteHostsprotected static java.lang.StringpropertyNameSuffix_Directoryprotected static java.lang.StringpropertyNameSuffix_HostNameOrIPAddressprotected static java.lang.StringpropertyNameSuffix_Passwordprotected static java.lang.StringpropertyNameSuffix_Securityprotected static java.lang.StringpropertyNameSuffix_User
-
Constructor Summary
Constructors Constructor Description FTPRemoteHostInformation()Construct an empty container for properties of FTP network devices.FTPRemoteHostInformation(java.util.Properties properties)Extract the FTP network properties from the supplied properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String localName, FTPRemoteHost frh)Add a new host.voidadd(java.lang.String localName, java.lang.String host, java.lang.String user, java.lang.String password, java.lang.String directory, FTPSecurityType security)Add a new remote FTP host.java.util.SetgetListOfLocalNames()Return the set of local names of remote hosts.java.util.PropertiesgetProperties(java.util.Properties properties)Retrieve the FTP network properties.FTPRemoteHostgetRemoteHost(java.lang.String localName)Get the information for the specified remote host.voidremove(java.lang.String localName)Remove a host.voidremoveAll()Completely empty all information.java.lang.StringtoString()
-
-
-
Field Detail
-
propertyName_FtpRemoteHosts
public static final java.lang.String propertyName_FtpRemoteHosts
- See Also:
- Constant Field Values
-
propertyNameSuffix_HostNameOrIPAddress
protected static final java.lang.String propertyNameSuffix_HostNameOrIPAddress
- See Also:
- Constant Field Values
-
propertyNameSuffix_User
protected static final java.lang.String propertyNameSuffix_User
- See Also:
- Constant Field Values
-
propertyNameSuffix_Password
protected static final java.lang.String propertyNameSuffix_Password
- See Also:
- Constant Field Values
-
propertyNameSuffix_Directory
protected static final java.lang.String propertyNameSuffix_Directory
- See Also:
- Constant Field Values
-
propertyNameSuffix_Security
protected static final java.lang.String propertyNameSuffix_Security
- See Also:
- Constant Field Values
-
propertyDelimitersForTokenizer_FtpRemoteAEs
protected static final java.lang.String propertyDelimitersForTokenizer_FtpRemoteAEs
- See Also:
- Constant Field Values
-
localNameToRemoteHostMap
protected final java.util.TreeMap<java.lang.String,FTPRemoteHost> localNameToRemoteHostMap
-
-
Constructor Detail
-
FTPRemoteHostInformation
public FTPRemoteHostInformation()
Construct an empty container for properties of FTP network devices.
-
FTPRemoteHostInformation
public FTPRemoteHostInformation(java.util.Properties properties) throws FTPExceptionExtract the FTP network properties from the supplied properties.
- Parameters:
properties-- Throws:
FTPException
-
-
Method Detail
-
getProperties
public java.util.Properties getProperties(java.util.Properties properties)
Retrieve the FTP network properties.
param properties the existing properties to add to (removing any properties already there), or null if none- Returns:
- the updated properties or a new set of properties if none supplied
-
removeAll
public void removeAll()
Completely empty all information.
-
remove
public void remove(java.lang.String localName)
Remove a host.
- Parameters:
localName-
-
add
public void add(java.lang.String localName, FTPRemoteHost frh) throws FTPExceptionAdd a new host.
- Parameters:
localName-frh-- Throws:
FTPException- if local name already used, or either is null or empty
-
add
public void add(java.lang.String localName, java.lang.String host, java.lang.String user, java.lang.String password, java.lang.String directory, FTPSecurityType security) throws FTPExceptionAdd a new remote FTP host.
- Parameters:
localName-host-user-password-directory-security-- Throws:
FTPException- if local name or AET already used, or either is null or empty
-
getRemoteHost
public FTPRemoteHost getRemoteHost(java.lang.String localName)
Get the information for the specified remote host.
- Parameters:
localName-- Returns:
- the remote host information
-
getListOfLocalNames
public java.util.Set getListOfLocalNames()
Return the set of local names of remote hosts.
- Returns:
- the set of local names
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-