IP*Works! SSL V9

ipworksssl
Class Ftps

java.lang.Object
  extended by ipworksssl.Ftps

public class Ftps
extends java.lang.Object

The FTPS Bean can be used to transfer files to and from FTP servers using the FTP Protocol.

The FTPS Bean is the SSL-enabled equivalent of the IP*Works! FTP bean. The main difference is the introduction of a set of new configuration settings, properties and events that deal with SSL security. The ipworksssl.Ftps#config and {@link ipworksssl.Ftps#config configuration settings determine which protocols are enabled and at what security level. The {@link ipworksssl.Ftps#getSSLCert SSLCert} property is used to select a client certificate if the server is requesting client authentication. The {@link ipworksssl.Ftps#config configuration setting, together with the {@link ipworksssl.FtpsSSLServerAuthenticationEvent SSLServerAuthentication} event allow you to check the server identity and other security attributes. Finally, the {@link ipworksssl.FtpsSSLStatusEvent SSLStatus} event provides information about the SSL handshake.

The FTPS Bean implements a standard FTP client as specified in RFC 959 and RFC 1579 with the added option of SSL security (RFC 2228) in both the protocol and data channels.

The first step in using the bean is specifying the {@link ipworksssl.Ftps#getRemoteHost RemoteHost} , {@link ipworksssl.Ftps#getUser User} and {@link ipworksssl.Ftps#getPassword Password} . The file to upload to or download from is given by the {@link ipworksssl.Ftps#getRemoteFile RemoteFile} property. The file to download to or upload from is specified by {@link ipworksssl.Ftps#getLocalFile LocalFile} . The current path in the server is specified by the {@link ipworksssl.Ftps#getRemotePath RemotePath} property. The {@link ipworksssl.Ftps#isPassive Passive} property is especially useful if the client is behind a firewall which inhibits incoming connections to higher ports.

If {@link ipworksssl.Ftps#getLocalFile LocalFile} is set to something other than an empty string, then files are received in {@link ipworksssl.Ftps#getLocalFile LocalFile} , otherwise the data is received through the {@link ipworksssl.FtpsTransferEvent Transfer} event. {@link ipworksssl.FtpsStartTransferEvent StartTransfer} and {@link ipworksssl.FtpsEndTransferEvent EndTransfer} are fired at the beginning and end of transmission.

The {@link ipworksssl.FtpsPITrailEvent PITrail} event traces the interaction between the client and the server (the FTP Protocol Interface connection).

Directory listings are received through the {@link ipworksssl.FtpsDirListEvent DirList} event.


Field Summary
static int sslAutomatic
           
static int sslExplicit
           
static int sslImplicit
           
static int sslNone
           
static int tmASCII
           
static int tmBinary
           
static int tmDefault
           
 
Constructor Summary
Ftps()
          Creates an instance of Ftps Bean.
Ftps(java.lang.String runtimeLicense)
          Creates an instance of Ftps Bean with specified run-time license.
 
Method Summary
 void abort()
          Abort Current Upload/Download.
 void addFtpsEventListener(FtpsEventListener l)
           
 void append()
          Append data from LocalFile to a RemoteFile on an FTP server.
 java.lang.String config(java.lang.String configurationString)
          Sets or retrieves a {@link ipworksssl.Ftps#config configuration setting.
 void deleteFile(java.lang.String fileName)
          Remove a file specified by FileName from an FTP server.
 void doEvents()
          Processes events from the internal message queue.
 void download()
          Download a RemoteFile from an FTP server.
 java.lang.String getAccount()
          The user account to login with.
 DirEntryList getDirList()
          Collection of entries resulting in the last directory listing.
 long getFileSize()
          The size of the file pointed to by RemoteFile .
 java.lang.String getFileTime()
          The last modification time of the file pointed to by RemoteFile .
 Firewall getFirewall()
          A set of properties related to firewall access.
 java.lang.String getLastReply()
          The last reply from the server.
 java.lang.String getLocalFile()
          The path to a local file for download/upload.
 java.lang.String getLocalHost()
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 java.lang.String getPassword()
          The password to log in.
 java.lang.String getRemoteFile()
          The name of the remote file for uploading, downloading, etc.
 java.lang.String getRemoteHost()
          The domain name or IP address of the FTP server.
 java.lang.String getRemotePath()
          The current path in the FTP server.
 int getRemotePort()
          The port for the FTP service (default is 21).
 Certificate getSSLAcceptServerCert()
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 Certificate getSSLCert()
          The certificate to be used during SSL negotiation.
 Certificate getSSLServerCert()
          The server certificate for the last established connection.
 int getSSLStartMode()
          Determines how the bean starts the SSL negotiation.
 java.lang.String getStartByte()
          The byte index in RemoteFile and LocalFile from which to start the transmission.
 int getTimeout()
          A timeout for the bean.
 int getTransferMode()
          The transfer mode (ASCII or Binary).
 java.lang.String getUser()
          The user identifier to use for login.
 void interrupt()
          Interrupt the current method.
 boolean isConnected()
          Shows whether the bean is connected.
 boolean isFileExists()
          Returns True if the file specified by RemoteFile exists on the remote server.
 boolean isIdle()
          The current status of the component.
 boolean isOverwrite()
          Indicates whether or not the bean should overwrite files during transfer.
 boolean isPassive()
          Controls whether to direct the server into passive mode.
 void listDirectory()
          List the current directory specified by RemotePath on an FTP server.
 void listDirectoryLong()
          List extended directory information for RemotePath .
 void logoff()
          Logoff from the FTP server by posting a QUIT command.
 void logon()
          Logon to the FTP RemoteHost using the current User and Password .
 void makeDirectory(java.lang.String newDir)
          Create a directory on an FTP server.
 void removeDirectory(java.lang.String dirName)
          Remove a directory specified by DirName from an FTP server.
 void removeFtpsEventListener(FtpsEventListener l)
           
 void renameFile(java.lang.String newName)
          Change the name of RemoteFile to NewName .
 void setAccount(java.lang.String account)
          The user account to login with.
 void setCommand(java.lang.String command)
          Used to send additional commands directly to the server.
 void setConnected(boolean connected)
          Shows whether the bean is connected.
 void setDownloadStream(java.io.OutputStream downloadStream)
          Sets the stream to which the downloaded data from the server will be written.
 void setFirewall(Firewall firewall)
          A set of properties related to firewall access.
 void setLocalFile(java.lang.String localFile)
          The path to a local file for download/upload.
 void setLocalHost(java.lang.String localHost)
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 void setOverwrite(boolean overwrite)
          Indicates whether or not the bean should overwrite files during transfer.
 void setPassive(boolean passive)
          Controls whether to direct the server into passive mode.
 void setPassword(java.lang.String password)
          The password to log in.
 void setRemoteFile(java.lang.String remoteFile)
          The name of the remote file for uploading, downloading, etc.
 void setRemoteHost(java.lang.String remoteHost)
          The domain name or IP address of the FTP server.
 void setRemotePath(java.lang.String remotePath)
          The current path in the FTP server.
 void setRemotePort(int remotePort)
          The port for the FTP service (default is 21).
 void setSSLAcceptServerCert(Certificate SSLAcceptServerCert)
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 void setSSLCert(Certificate SSLCert)
          The certificate to be used during SSL negotiation.
 void setSSLStartMode(int SSLStartMode)
          Determines how the bean starts the SSL negotiation.
 void setStartByte(java.lang.String startByte)
          The byte index in RemoteFile and LocalFile from which to start the transmission.
 void setTimeout(int timeout)
          A timeout for the bean.
 void setTransferMode(int transferMode)
          The transfer mode (ASCII or Binary).
 void setUploadStream(java.io.InputStream uploadStream)
          Sets the stream from which the bean will read data to upload to the server.
 void setUser(java.lang.String user)
          The user identifier to use for login.
 void storeUnique()
          Upload a file with a Unique Name to an FTP server.
 void upload()
          Upload a file specified by LocalFile to an FTP server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sslAutomatic

public static final int sslAutomatic
See Also:
Constant Field Values

sslImplicit

public static final int sslImplicit
See Also:
Constant Field Values

sslExplicit

public static final int sslExplicit
See Also:
Constant Field Values

sslNone

public static final int sslNone
See Also:
Constant Field Values

tmDefault

public static final int tmDefault
See Also:
Constant Field Values

tmASCII

public static final int tmASCII
See Also:
Constant Field Values

tmBinary

public static final int tmBinary
See Also:
Constant Field Values
Constructor Detail

Ftps

public Ftps()
Creates an instance of Ftps Bean.


Ftps

public Ftps(java.lang.String runtimeLicense)
Creates an instance of Ftps Bean with specified run-time license.

Method Detail

getAccount

public java.lang.String getAccount()
The user account to login with.

This property contains the user account to use when logging in. Some servers may require an Account in order to Logon or in order to access specific privileges, like uploading or deleting files.


setAccount

public void setAccount(java.lang.String account)
                throws IPWorksSSLException
The user account to login with.

This property contains the user account to use when logging in. Some servers may require an Account in order to Logon or in order to access specific privileges, like uploading or deleting files.

Throws:
IPWorksSSLException

setCommand

public void setCommand(java.lang.String command)
                throws IPWorksSSLException
Used to send additional commands directly to the server.

This property can be used to send additional commands directly to the server. Check the LastReply property and/or trap the PITrail events coming from the server to get the response.

Throws:
IPWorksSSLException

isConnected

public boolean isConnected()
Shows whether the bean is connected.

This property is used to determine whether or not the bean is connected to the remote host.


setConnected

public void setConnected(boolean connected)
                  throws IPWorksSSLException
Shows whether the bean is connected.

This property is used to determine whether or not the bean is connected to the remote host.

Throws:
IPWorksSSLException

getDirList

public DirEntryList getDirList()
Collection of entries resulting in the last directory listing.

This property contains the collection of entries resulting in the last directory listing. A collection is returned after a response is received from the server after a call to either ListDirectory or ListDirectoryLong . The collection is made up of entries for each listing in the current directory, specified by the RemotePath property.

{@link ipworksssl.Ftps#config can be used to control the number of directory listings saved.

This collection is indexed from 0 to size - 1.


isFileExists

public boolean isFileExists()
Returns True if the file specified by RemoteFile exists on the remote server.

This property returns True if the file exists on the remote server. It returns false if the file does not exist. You must specify the file you wish to check by setting the RemoteFile prior to calling this method.

If the bean is busy or is not connected, 0 is returned.

If there is no FTP session in place, one is automatically created by first calling the Logon method.


getFileSize

public long getFileSize()
The size of the file pointed to by RemoteFile .

When this property is read, the FTP server is queried for the file size, and the response is provided as the property value.

If the bean is busy or is not connected, 0 is returned.


getFileTime

public java.lang.String getFileTime()
The last modification time of the file pointed to by RemoteFile .

When this property is read, the FTP server is queried for the file modification time, and the response is provided as the property value. The time will be converted to the local time zone.

If the bean is busy or is not connected, an empty string is returned.


getFirewall

public Firewall getFirewall()
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.


setFirewall

public void setFirewall(Firewall firewall)
                 throws IPWorksSSLException
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.

Throws:
IPWorksSSLException

isIdle

public boolean isIdle()
The current status of the component.

Idle will be False if the component is currently busy (communicating and/or waiting for an answer), and True at all other times.


getLastReply

public java.lang.String getLastReply()
The last reply from the server.

This property indicates the last reply received from the server. It can be used for informational purposes. The same information and more can also be retrieved through the PITrail event.


getLocalFile

public java.lang.String getLocalFile()
The path to a local file for download/upload. If the file exists, it is overwritten.

This property is used by the Upload and Download methods to specify the path to a local file to be downloaded/uploaded. See the method descriptions for more information.

Example (Setting LocalFile)

 FTPControl.LocalFile = "C:\localfile.txt"
 FTPControl.RemoteFile = "remotefile.txt"
 FTPControl.Download()
 
 FTPControl.LocalFile = "C:\localfile2.txt"
 FTPControl.RemoteFile = "folder/remotefile2.txt"
 FTPControl.Download() 


setLocalFile

public void setLocalFile(java.lang.String localFile)
                  throws IPWorksSSLException
The path to a local file for download/upload. If the file exists, it is overwritten.

This property is used by the Upload and Download methods to specify the path to a local file to be downloaded/uploaded. See the method descriptions for more information.

Example (Setting LocalFile)

 FTPControl.LocalFile = "C:\localfile.txt"
 FTPControl.RemoteFile = "remotefile.txt"
 FTPControl.Download()
 
 FTPControl.LocalFile = "C:\localfile2.txt"
 FTPControl.RemoteFile = "folder/remotefile2.txt"
 FTPControl.Download() 

Throws:
IPWorksSSLException

getLocalHost

public java.lang.String getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.


setLocalHost

public void setLocalHost(java.lang.String localHost)
                  throws IPWorksSSLException
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.

Throws:
IPWorksSSLException

isOverwrite

public boolean isOverwrite()
Indicates whether or not the bean should overwrite files during transfer.

This property is a value indicating whether or not the bean should overwrite downloaded files. If Overwrite is false, an error will be thrown whenever LocalFile exists before a download operation.


setOverwrite

public void setOverwrite(boolean overwrite)
                  throws IPWorksSSLException
Indicates whether or not the bean should overwrite files during transfer.

This property is a value indicating whether or not the bean should overwrite downloaded files. If Overwrite is false, an error will be thrown whenever LocalFile exists before a download operation.

Throws:
IPWorksSSLException

isPassive

public boolean isPassive()
Controls whether to direct the server into passive mode. Recommended if behind a firewall.

This property controls whether to direct the server into passive mode. Many firewalls will not allow the FTP server to open a connection from outside to the higher ports where the FTP client bean expects them. If Passive is set to TRUE , the bean will use the PASV instead of the PORT command and will thus direct the server into passive mode: connections are initiated only by the client.


setPassive

public void setPassive(boolean passive)
                throws IPWorksSSLException
Controls whether to direct the server into passive mode. Recommended if behind a firewall.

This property controls whether to direct the server into passive mode. Many firewalls will not allow the FTP server to open a connection from outside to the higher ports where the FTP client bean expects them. If Passive is set to TRUE , the bean will use the PASV instead of the PORT command and will thus direct the server into passive mode: connections are initiated only by the client.

Throws:
IPWorksSSLException

getPassword

public java.lang.String getPassword()
The password to log in.

This property contains the password used to log in and must be set before the bean connects to the FTP server.


setPassword

public void setPassword(java.lang.String password)
                 throws IPWorksSSLException
The password to log in.

This property contains the password used to log in and must be set before the bean connects to the FTP server.

Throws:
IPWorksSSLException

getRemoteFile

public java.lang.String getRemoteFile()
The name of the remote file for uploading, downloading, etc.

This property contains the name of the remote file to upload, download, etc. and is either an absolute file path, or a relative path based on RemotePath .

A number of methods use RemoteFile as an argument.

Example (Setting RemoteFile)

 FTPControl.LocalFile = "C:\localfile.txt"
 FTPControl.RemoteFile = "remotefile.txt"
 FTPControl.Download()
 
 FTPControl.LocalFile = "C:\localfile2.txt"
 FTPControl.RemoteFile = "folder/remotefile2.txt"
 FTPControl.Download() 

Note: This property will also act as a file mask when performing ListDirectory or ListDirectoryLong .

Example (Using RemoteFile as a file mask):

 FTPControl.RemoteFile = "*.txt"
 FTPControl.ListDirectory() 

The RemoteFile property supports several pattern matching characters. The following special characters are supported for pattern matching:

?
Any single character.
*
Any characters or no characters. I.E., C*t matches Cat, Cot, Coast, Ct, etc)
[,-]
A range of characters. E.g.: [a-z], [a], [0-9], [0-9,a-d,f,r-z], etc.
\
The slash is ignored and exact matching is performed on the next character.

If the above characters need to be used as a literal in a FileMask then they must be escaped by surrounding them with a []. (Note, "]" and "-" do not need to be escaped) See below for the escape sequences:

Character
Escape Sequence
?
[?]
*
[*]
[
[[]
\
[\]

For example, if you wanted to download a file whose name was [Something].txt you could set the RemoteFile property to: [[]Something].txt


setRemoteFile

public void setRemoteFile(java.lang.String remoteFile)
                   throws IPWorksSSLException
The name of the remote file for uploading, downloading, etc.

This property contains the name of the remote file to upload, download, etc. and is either an absolute file path, or a relative path based on RemotePath .

A number of methods use RemoteFile as an argument.

Example (Setting RemoteFile)

 FTPControl.LocalFile = "C:\localfile.txt"
 FTPControl.RemoteFile = "remotefile.txt"
 FTPControl.Download()
 
 FTPControl.LocalFile = "C:\localfile2.txt"
 FTPControl.RemoteFile = "folder/remotefile2.txt"
 FTPControl.Download() 

Note: This property will also act as a file mask when performing ListDirectory or ListDirectoryLong .

Example (Using RemoteFile as a file mask):

 FTPControl.RemoteFile = "*.txt"
 FTPControl.ListDirectory() 

The RemoteFile property supports several pattern matching characters. The following special characters are supported for pattern matching:

?
Any single character.
*
Any characters or no characters. I.E., C*t matches Cat, Cot, Coast, Ct, etc)
[,-]
A range of characters. E.g.: [a-z], [a], [0-9], [0-9,a-d,f,r-z], etc.
\
The slash is ignored and exact matching is performed on the next character.

If the above characters need to be used as a literal in a FileMask then they must be escaped by surrounding them with a []. (Note, "]" and "-" do not need to be escaped) See below for the escape sequences:

Character
Escape Sequence
?
[?]
*
[*]
[
[[]
\
[\]

For example, if you wanted to download a file whose name was [Something].txt you could set the RemoteFile property to: [[]Something].txt

Throws:
IPWorksSSLException

getRemoteHost

public java.lang.String getRemoteHost()
The domain name or IP address of the FTP server.

This property specifies the IP address (IP number in dotted internet format) or Domain Name of the FTP server. It is set before a connection is attempted and cannot be changed once a connection is in progress.

If this property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.


setRemoteHost

public void setRemoteHost(java.lang.String remoteHost)
                   throws IPWorksSSLException
The domain name or IP address of the FTP server.

This property specifies the IP address (IP number in dotted internet format) or Domain Name of the FTP server. It is set before a connection is attempted and cannot be changed once a connection is in progress.

If this property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

Throws:
IPWorksSSLException

getRemotePath

public java.lang.String getRemotePath()
The current path in the FTP server.

This property shows the current working directory on the FTP server. It can also be used to change the working directory by setting it to an absolute directory path, or a relative path with respect to the existing value of this property.

If the first two bytes of the new path are "..", then a change to one level above in the directory tree is performed.

Setting this property causes the bean to send the appropriate command to the remote server only if connected.

Example (Changing Directory)

 FTPControl.Logon()
 FTPControl.RemotePath = "/home/user" 


setRemotePath

public void setRemotePath(java.lang.String remotePath)
                   throws IPWorksSSLException
The current path in the FTP server.

This property shows the current working directory on the FTP server. It can also be used to change the working directory by setting it to an absolute directory path, or a relative path with respect to the existing value of this property.

If the first two bytes of the new path are "..", then a change to one level above in the directory tree is performed.

Setting this property causes the bean to send the appropriate command to the remote server only if connected.

Example (Changing Directory)

 FTPControl.Logon()
 FTPControl.RemotePath = "/home/user" 

Throws:
IPWorksSSLException

getRemotePort

public int getRemotePort()
The port for the FTP service (default is 21).

This property contains the port for the FTP service, which defaults to 21 if not set. A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.

For implicit SSL, use port 990 (please refer to the SSLStartMode property for more information).


setRemotePort

public void setRemotePort(int remotePort)
                   throws IPWorksSSLException
The port for the FTP service (default is 21).

This property contains the port for the FTP service, which defaults to 21 if not set. A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.

For implicit SSL, use port 990 (please refer to the SSLStartMode property for more information).

Throws:
IPWorksSSLException

getSSLAcceptServerCert

public Certificate getSSLAcceptServerCert()
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.

If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.

You may override this behavior by supplying a value for SSLAcceptServerCert . If the certificate supplied in SSLAcceptServerCert is the same as the certificate presented by the server, then the server certificate is accepted unconditionally, and the connection will continue normally.

Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, this property may create a security breach. Use it at your own risk.


setSSLAcceptServerCert

public void setSSLAcceptServerCert(Certificate SSLAcceptServerCert)
                            throws IPWorksSSLException
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.

If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.

You may override this behavior by supplying a value for SSLAcceptServerCert . If the certificate supplied in SSLAcceptServerCert is the same as the certificate presented by the server, then the server certificate is accepted unconditionally, and the connection will continue normally.

Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, this property may create a security breach. Use it at your own risk.

Throws:
IPWorksSSLException

getSSLCert

public Certificate getSSLCert()
The certificate to be used during SSL negotiation.

The digital certificate that the bean will use during SSL negotiation. Set this property to a valid certificate before starting SSL negotiation. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the store and subject fields.


setSSLCert

public void setSSLCert(Certificate SSLCert)
                throws IPWorksSSLException
The certificate to be used during SSL negotiation.

The digital certificate that the bean will use during SSL negotiation. Set this property to a valid certificate before starting SSL negotiation. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the store and subject fields.

Throws:
IPWorksSSLException

getSSLServerCert

public Certificate getSSLServerCert()
The server certificate for the last established connection.

SSLServerCert contains the server certificate for the last established connection.

SSLServerCert is reset every time a new connection is attempted.


getSSLStartMode

public int getSSLStartMode()
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic - default)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.


setSSLStartMode

public void setSSLStartMode(int SSLStartMode)
                     throws IPWorksSSLException
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic - default)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.

Throws:
IPWorksSSLException

getStartByte

public java.lang.String getStartByte()
The byte index in RemoteFile and LocalFile from which to start the transmission.

This property contains a zero-based index in both RemoteFile and LocalFile that determines the point where the transmission of data starts from. This is useful for resuming interrupted downloads and uploads of files from FTP servers.

Once set, the StartByte index is used for all future downloads/uploads. The property must be reset to "0" for normal downloads/uploads.

The type of the property is a string instead of numeric to allow for certain implementations that expect an alphanumeric marker of the start index.

In the Transfer event, the TransferredBytes parameter will include the bytes skipped (i.e. it will show StartByte more bytes than actually transferred).

NOTE: some FTP servers may not support the FTP 'REST' command. If that is the case with the server you are accessing, you will not be able to use the StartByte property.


setStartByte

public void setStartByte(java.lang.String startByte)
                  throws IPWorksSSLException
The byte index in RemoteFile and LocalFile from which to start the transmission.

This property contains a zero-based index in both RemoteFile and LocalFile that determines the point where the transmission of data starts from. This is useful for resuming interrupted downloads and uploads of files from FTP servers.

Once set, the StartByte index is used for all future downloads/uploads. The property must be reset to "0" for normal downloads/uploads.

The type of the property is a string instead of numeric to allow for certain implementations that expect an alphanumeric marker of the start index.

In the Transfer event, the TransferredBytes parameter will include the bytes skipped (i.e. it will show StartByte more bytes than actually transferred).

NOTE: some FTP servers may not support the FTP 'REST' command. If that is the case with the server you are accessing, you will not be able to use the StartByte property.

Throws:
IPWorksSSLException

getTimeout

public int getTimeout()
A timeout for the bean.

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by the ipworksssl.Ftps#config configuration setting.

The default value for the {@link ipworksssl.Ftps#getTimeout Timeout} property is 60 (seconds).


setTimeout

public void setTimeout(int timeout)
                throws IPWorksSSLException
A timeout for the bean.

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by the ipworksssl.Ftps#config configuration setting.

The default value for the {@link ipworksssl.Ftps#getTimeout Timeout} property is 60 (seconds).

Throws:
IPWorksSSLException

getTransferMode

public int getTransferMode()
The transfer mode (ASCII or Binary). If the value is 0 (default), the initial server mode will be used.

This property specifies the transfer mode, either ASCII or binary. The valid options for the TransferMode property are as follows:

tmDefault (0)
The initial mode of the FTP server is taken. No change.
tmASCII (1)
Files are transferred in ASCII mode (TYPE A).
tmBinary (2)
Files are transferred in Binary mode (TYPE I).


setTransferMode

public void setTransferMode(int transferMode)
                     throws IPWorksSSLException
The transfer mode (ASCII or Binary). If the value is 0 (default), the initial server mode will be used.

This property specifies the transfer mode, either ASCII or binary. The valid options for the TransferMode property are as follows:

tmDefault (0)
The initial mode of the FTP server is taken. No change.
tmASCII (1)
Files are transferred in ASCII mode (TYPE A).
tmBinary (2)
Files are transferred in Binary mode (TYPE I).

Throws:
IPWorksSSLException

getUser

public java.lang.String getUser()
The user identifier to use for login.

This property contains the user identifier to be used when logging in and must be set before the bean connects to the FTP server.


setUser

public void setUser(java.lang.String user)
             throws IPWorksSSLException
The user identifier to use for login.

This property contains the user identifier to be used when logging in and must be set before the bean connects to the FTP server.

Throws:
IPWorksSSLException

abort

public void abort()
           throws IPWorksSSLException
Abort Current Upload/Download.

This method sends an ABOR command to the FTP server. It is used to interrupt file uploads/downloads.

Throws:
IPWorksSSLException

append

public void append()
            throws IPWorksSSLException
Append data from LocalFile to a RemoteFile on an FTP server.

This method causes the server-DTP to accept the data transferred via the data connection and to store the data in a file on the server site. If the file specified in the pathname exists on the server site, then the data shall be appended to that file; otherwise the file specified in the pathname shall be created on the server site. Similar to the Upload method but the local file specified by LocalFile is appended to RemoteFile on the server as opposed to replacing it as done by the Upload method. RemoteFile is either an absolute path on the server, or a path relative to RemotePath . The server will create a file with that name if it doesn't already exist (similar to Upload). If there is no FTP session in place, one is automatically created by first calling the Logon method.

Throws:
IPWorksSSLException

config

public java.lang.String config(java.lang.String configurationString)
                        throws IPWorksSSLException
Sets or retrieves a ipworksssl.Ftps#config configuration setting.

{@link ipworksssl.Ftps#config Config} is a generic method available in every bean. It is used to set and retrieve {@link ipworksssl.Ftps#config configuration settingsfor the bean.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the {@link ipworksssl.Ftps#config Config} method.

To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a {@link ipworksssl.Ftps#config configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.

The bean accepts one or more of the following configuration settings . Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the {@link ipworksssl.Ftps#config Config} method.

FTP Configuration Settings

ActiveModePORTAddress
Allows the specification of the PORT address value for active mode connections
When using an active mode configuration ( {@link ipworksssl.Ftps#isPassive Passive} = False) with a firewall, it may sometimes be necessary to specify the actual PORT value to be sent to the server. {@link ipworksssl.Ftps#config takes the protocol-level parameter in the form "a,b,c,d,e,f" where "a,b,c,d" is the external IP address separated by commas, and e and f represent, respectively, the high byte (divide by 256) and the low byte (mod 256) values of the external port where the FTP client is listening.This config must be used in conjunction with {@link ipworksssl.Ftps#config to ensure that the correct port is used by the client.

ActiveModeIP
Allows the specification of the IP address that the server will connect to for active mode connections
The {@link ipworksssl.Ftps#config config can be used to specify the IP address that the server will connect to when using an active mode configuarion ( {@link ipworksssl.Ftps#isPassive Passive} = False). When this config is set, the port number where the component listens for active mode connections will still be managed by the component. The {@link ipworksssl.Ftps#config can also be used to ensure that the correct port is used by the client.Note that this config will be ignored if {@link ipworksssl.Ftps#config is also specified.

AppendToLocalFile
Append downloaded files to a local file
If set to true, the downloaded files will be appended to the file specified in {@link ipworksssl.Ftps#getLocalFile LocalFile} .
CalculatePercentDone
Enables or Disables calculating the percent complete for downloads
When set to True, the bean sends an FTP "SIZE" command to retrieve the file size before beginning a download. When downloading a large quantity of small files, performance may be increased by disabling this feature.
DirEntryPattern
Allows the use of regular expressions to parse non-standard directory entry formats
In some cases, the server may return a directory entry format that can not be automatically parsed by the adapter. In this case the full entry format can be seen in the DirEntry parameter of {@link ipworksssl.FtpsDirListEvent DirList} . You can then use this property to define a regular expression to parse the entry. The value of this setting is specified in the following format:
 A,B,C,X=Y|RegEx 
A,B,C, and X represent integer values that correspond to the capturing groups of the regular expression in the following order:
  • FileName
  • FileSize
  • FileTime
  • IsDir

Since group X represents the IsDir value, the user must specify Y to indicate what value that group must have in order for IsDir to be true.

Take for instance a simple entry in this format:

 22 Test.txt 
In this example "22" is the FileSize and "Test.txt" is the FileName. In order to parse this entry we will define the DirEntryPattern as:
 2,1,-1,-1|([0-9]+)\s(.*) 
The first value "2" indicates that the first field (FileName) corresponds to the second capturing group in the regular expression. The second value "1" indicates that the second field (FileSize) corresponds to the first capturing group in the regular expression. The capturing group is the regular expression in parenthesis. In the above example, the first capturing group is ([0-9]+) and the second capturing group is (.*).

As seen in the above example -1 can also be specified as the integer value. When this is specified that field is ignored.

DILinger
When set to True, DI connections are terminated gracefully
This property controls how the DI connection is closed. The default is True.In the case that DILinger is True (default), there are two scenarios for determining how long the connection will linger. The first, if {@link ipworksssl.Ftps#config is 0 (default), the system will attempt to send pending data for a connection until the default IP protocol timeout expires.

In the second scenario, {@link ipworksssl.Ftps#config is a positive value, the system will attempt to send pending data until the specified {@link ipworksssl.Ftps#config is reached. If this attempt fails, then the system will reset the connection.

The default behavior (which is also the default mode for stream sockets) might result in a long delay in closing the connection. Although the bean returns control immediately, the system could hold system resources until all pending data is sent (even after your application closes).

Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.

DILingerTime
Time in seconds to have the DI connection linger
LingerTime is the time, in seconds, to leave the socket connection linger. This value is 0 by default, which means it will use the default IP protocol timeout.
FileTimeFormat
The format of file time reported by the server
The default value is "M/d/yyyy hh:mm:ss tt". When set, the bean will format the time returned by the server in the {@link ipworksssl.Ftps#getFileTime FileTime} property. To disable all formatting set this to empty string.Note: This setting only applies to the {@link ipworksssl.Ftps#getFileTime FileTime} property. It does not apply to the FileTime parameter of the {@link ipworksssl.FtpsDirListEvent DirList} event.

MaxDirEntries
Instructs bean to save the amount of entries specified that are returned by the server after a ListDirectory call has been made
This config should be set when populating the {@link ipworksssl.Ftps#getDirList DirList} collection after a call to either {@link ipworksssl.Ftps#listDirectory ListDirectory} or {@link ipworksssl.Ftps#listDirectoryLong ListDirectoryLong} . This value represents the number of entries that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is -1, so all items will be included in the collection .

NOTE: This functionality is only available in Java and .NET.

PortRange
Allows the specification of a port range where the bean listens for active mode connections
When set to use active mode ( {@link ipworksssl.Ftps#isPassive Passive} = False), the bean uses any available port to listen to incoming connections from the server. You can override this behavior by setting {@link ipworksssl.Ftps#config to a value containing the range of ports the bean will be listening to.The range is provided as start-end , for instance: "1024-" stands for anything higher than 1024, "1024-2048" stands for ports between 1024 and 2048 inclusive, "4000-4010, 50000-50010" stands for ports between 4000 and 4010 or between 50000 and 50010.

RealTimeUpload
Enables real time uploading
When this value is set to "True" the bean will upload the data in the file specified by {@link ipworksssl.Ftps#getLocalFile LocalFile} and continue monitoring {@link ipworksssl.Ftps#getLocalFile LocalFile} for additional data to upload until no new data is found for {@link ipworksssl.Ftps#config seconds. This allows you to start uploading a file immediately after the file is created and continue uploading as data is written to the file. The default value is "False".
RealTimeUploadAgeLimit
The age limit in seconds when using RealTimeUpload
This value is only applicable when {@link ipworksssl.Ftps#config is set to "True". This specifies the number of seconds for which the bean will monitor {@link ipworksssl.Ftps#getLocalFile LocalFile} for new data to upload. If this limit is reached and no new data is found in {@link ipworksssl.Ftps#getLocalFile LocalFile} the upload will complete. The default value is "1".
UseEPSV
Allows extended passive mode
When set, extended passive mode will be used.
UseMLSD
Uses listings for machine processing
When this is set to True the bean will list files in the directory using the MLSD command. This command is an extension to the protocol which defines a more standardized and reliable directory listing format. Not all servers support this command. The default value is False.When set to True, set {@link ipworksssl.Ftps#getRemoteFile RemoteFile} to the filemask and call either {@link ipworksssl.Ftps#listDirectory ListDirectory} or {@link ipworksssl.Ftps#listDirectoryLong ListDirectoryLong} . There is no difference between the two methods when this setting is enabled.

UseMLST
Uses single file listing for machine processing
This setting is similar to {@link ipworksssl.Ftps#config except that it is only valid for a single file. When this is set to True the bean will list the file or folder specified by {@link ipworksssl.Ftps#getRemoteFile RemoteFile} . If {@link ipworksssl.Ftps#getRemoteFile RemoteFile} is not set, a listing for the current directory itself will be returned. This command is an extension to the protocol which defines a more standardized and reliable directory listing format, but for a single file or folder only. Not all servers support this command. The default value is False.When set to True, set {@link ipworksssl.Ftps#getRemoteFile RemoteFile} to the file or folder you wish to get information about and call either {@link ipworksssl.Ftps#listDirectory ListDirectory} or {@link ipworksssl.Ftps#listDirectoryLong ListDirectoryLong} . There is no difference between the two methods when this setting is enabled. When both {@link ipworksssl.Ftps#config and {@link ipworksssl.Ftps#config are set, {@link ipworksssl.Ftps#config takes precedence.

UseModeZ
Allows compression to be used when transferring data
The default value is false. When set to true the bean will issue the "MODE Z" command to the FTP server. This will enable deflate compression so all data transferred is first compressed either by the server (when downloading) or by the bean (when uploading). Note that not all servers support this feature.
ModeZCompressionLevel
Used to specify the level of compression used
The default value is 7. Valid values are from 0 to 9. A higher value indicates a higher compression level is used. This is only valid when {@link ipworksssl.Ftps#config is set to True.
UseRemoteHostAddressForPassive
Instructs the bean to use the address specified by RemoteHost when establishing a data connection
When this setting is True (default), the bean will use the address specified by {@link ipworksssl.Ftps#getRemoteHost RemoteHost} when establishing a data connection for directory listings and file transfers. When this setting is False, the bean will use the address provided by the server in response to the PASV command.This setting is only applicable when {@link ipworksssl.Ftps#isPassive Passive} is True.

FTPS Configuration Settings

UseClearChannel
Allows for the Clear Command Channel (CCC) command
When set, the bean will send the CCC command to the server requesting a clear (unprotected) command channel.
UseClearDataChannel
Allows for the PROT C command
When this is set, the bean will use a clear (unprotected) data channel by sending the PROT C command to the server.
UseOldAUTHSSL
Allows use of the 'AUTH SSL' command instead of 'AUTH TLS'
By default, the bean uses the standard "AUTH TLS" command to initiate the SSL handshake with the server. This configuration setting is included for optional support of older servers which support only the "AUTH SSL". command.Using "AUTH SSL" instead of "AUTH TLS" is STRONGLY discouraged due to potential security vulnerabilities. If you must use this configuration setting, please do so very carefully.

UseProtWhenImplicit
Sends the PROT P command to the server
When {@link ipworksssl.Ftps#getSSLStartMode SSLStartMode} is set to sslImplicit , setting this to true will instruct the bean to send the PROT P command to the server. This explicitly tells the server that the data channel will be protected. The default value is true.
VirtualHostName
Sends the HOST command to the server
Defined in RFC 7151, the HOST command allows user-FTP processes to specify which virtual host to connect to for a server-FTP process that is handling requests for multiple virtual hosts on a single IP address. When this config is set, the HOST command is sent to the server prior to authenticating.

IPPort Configuration Settings

ConnectionTimeout
Sets a separate timeout value for establishing a connection
When set, this configuration setting allows you to specify a different timeout value for establishing a connection. Otherwise, the bean will use {@link ipworksssl.Ftps#getTimeout Timeout} for establishing a connection and transmitting/receiving data.
FirewallAutoDetect
Tells the bean whether or not to automatically detect and use firewall system settings, if available
This is the same as AutoDetect . This setting is provided for use by beans that do not directly expose Firewall properties.
FirewallHost
Name or IP address of firewall (optional)
If a {@link ipworksssl.Ftps#config is given, requested connections will be authenticated through the specified firewall when connecting.If the {@link ipworksssl.Ftps#config setting is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the {@link ipworksssl.Ftps#config setting is set to the corresponding address. If the search is not successful, an error is returned.

NOTE: This is the same as Host . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallListener
If true, the component binds to a SOCKS firewall as a server (IPPort only)
This entry is for IPPort only and does not work for other components that descend from IPPort.If this entry is set, the bean acts as a server. {@link ipworksssl.Ftps#getRemoteHost RemoteHost} and {@link ipworksssl.Ftps#getRemotePort RemotePort} are used to tell the SOCKS firewall in which address and port to listen to. The firewall rules may ignore {@link ipworksssl.Ftps#getRemoteHost RemoteHost} , and it is recommended that {@link ipworksssl.Ftps#getRemoteHost RemoteHost} be set to empty string in this case.

{@link ipworksssl.Ftps#getRemotePort RemotePort} is the port in which the firewall will listen to. If set to 0, the firewall will select a random port. The binding (address and port) is provided through the {@link ipworksssl.FtpsConnectionStatusEvent ConnectionStatus} event.

The connection to the firewall is made by calling the {@link ipworksssl.Ftps#connect Connect} method.

FirewallPassword
Password to be used if authentication is to be used when connecting through the firewall
If {@link ipworksssl.Ftps#config is specified, the {@link ipworksssl.Ftps#config and {@link ipworksssl.Ftps#config settings are used to connect and authenticate to the given firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as Password . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallPort
The TCP port for the FirewallHost;
Note that the {@link ipworksssl.Ftps#config is set automatically when {@link ipworksssl.Ftps#config is set to a valid value.NOTE: This is the same as Port . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallType
Determines the type of firewall to connect through
The appropriate values are as follows:
0
No firewall (default setting).
1
Connect through a tunneling proxy. {@link ipworksssl.Ftps#config is set to 80.
2
Connect through a SOCKS4 Proxy. {@link ipworksssl.Ftps#config is set to 1080.
3
Connect through a SOCKS5 Proxy. {@link ipworksssl.Ftps#config is set to 1080.
NOTE: This is the same as FirewallType . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallUser
A user name if authentication is to be used connecting through a firewall
If the {@link ipworksssl.Ftps#config is specified, the {@link ipworksssl.Ftps#config and {@link ipworksssl.Ftps#config settings are used to connect and authenticate to the Firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as User . This setting is provided for use by beans that do not directly expose Firewall properties.

KeepAliveTime
The inactivity time in milliseconds before a TCP keep-alive packet is sent
When set, {@link ipworksssl.Ftps#config will automatically be set to true. By default the operating system will determine the time a connection is idle before a TCP keep-alive packet is sent. This system default if this value is not specified here is 2 hours. In many cases a shorter interval is more useful. Set this value to the desired interval in milliseconds.Note: This value is not applicable in Java.

KeepAliveInterval
The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received
When set, {@link ipworksssl.Ftps#config will automatically be set to true. A TCP keep-alive packet will be sent after a period of inactivity as defined by {@link ipworksssl.Ftps#config . If no acknowledgement is received from the remote host the keep-alive packet will be re-sent. This setting specifies the interval at which the successive keep-alive packets are sent in milliseconds. This system default if this value is not specified here is 1 second.Note: This value is not applicable in Java or MAC.

Linger
When set to True, connections are terminated gracefully
This property controls how a connection is closed. The default is True.In the case that Linger is True (default), there are two scenarios for determining how long the connection will linger. The first, if {@link ipworksssl.Ftps#config is 0 (default), the system will attempt to send pending data for a connection until the default IP protocol timeout expires.

In the second scenario, {@link ipworksssl.Ftps#config is a positive value, the system will attempt to send pending data until the specified {@link ipworksssl.Ftps#config is reached. If this attempt fails, then the system will reset the connection.

The default behavior (which is also the default mode for stream sockets) might result in a long delay in closing the connection. Although the bean returns control immediately, the system could hold system resources until all pending data is sent (even after your application closes).

Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.

LingerTime
Time in seconds to have the connection linger
LingerTime is the time, in seconds, to leave the socket connection linger. This value is 0 by default, which means it will use the default IP protocol timeout.
LocalHost
The name of the local host through which connections are initiated or accepted
The {@link ipworksssl.Ftps#getLocalHost LocalHost} setting contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the {@link ipworksssl.Ftps#getLocalHost LocalHost} setting shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

LocalPort
The TCP port in the local host where the bean binds
This must be set before a connection is attempted. It instructs the bean to bind to a specific port (or communication endpoint) in the local machine.Setting this to 0 (default) enables the system to choose a port at random. The chosen port will be shown by {@link ipworksssl.Ftps#getLocalPort LocalPort} after the connection is established.

{@link ipworksssl.Ftps#getLocalPort LocalPort} cannot be changed once a connection is made. Any attempt to set this when a connection is active will generate an error.

This; setting is useful when trying to connect to services that require a trusted port in the client side. An example is the remote shell (rsh) service in UNIX systems.

MaxLineLength
The maximum amount of data to accumulate when no EOL is found
{@link ipworksssl.Ftps#config is the size of an internal buffer, which holds received data while waiting for an {@link ipworksssl.Ftps#getEOL EOL} string.If an {@link ipworksssl.Ftps#getEOL EOL} string is found in the input stream before {@link ipworksssl.Ftps#config bytes are received, the {@link ipworksssl.FtpsDataInEvent DataIn} event is fired with the EOL parameter set to True, and the buffer is reset.

If no {@link ipworksssl.Ftps#getEOL EOL} is found, and {@link ipworksssl.Ftps#config bytes are accumulated in the buffer, the {@link ipworksssl.FtpsDataInEvent DataIn} event is fired with the EOL parameter set to False, and the buffer is reset.

The minimum value for {@link ipworksssl.Ftps#config is 256 bytes. The default value is 2048 bytes. The maximum value is 65536 bytes.

MaxTransferRate
The transfer rate limit in bytes per second
This setting can be used to throttle outbound TCP traffic. Set this to the number of bytes to be sent per second. By default this is not set and there is no limit.
TCPKeepAlive
Determines whether or not the keep alive socket option is enabled
If set to true, the socket's keep-alive option is enabled and keep-alive packets will be sent periodically to maintain the connection. Set {@link ipworksssl.Ftps#config and {@link ipworksssl.Ftps#config to configure the timing of the keep-alive packets.Note: This value is not applicable in Java.

UseIPv6
Whether or not to use IPv6
By default, the component expects an IPv4 address for local and remote host properties, and will create an IPv4 socket. To use IPv6 instead, set this to True.
CloseStreamAfterTransfer
If true, the component will close the upload or download stream after the transfer
This setting determines whether the input or output stream is closed after the transfer completes. When set to True (default), all streams will be closed after a transfer is completed. In order to keep streams open after the transfer of data, set this to False. the default value is True.
TcpNoDelay
Whether or not to delay when sending packets
When true, the socket will send all data that is ready to send at once. When false, the socket will send smaller buffered packets of data at small intervals. This is known as the Nagle algorithm.By default, this config is set to false.

SSL Configuration Settings

ReuseSSLSession
Determines if the SSL session is reused
If set to true, the component will reuse the context if and only if the following criteria are met:
  • The target host name is the same.
  • The system cache entry has not expired (default timeout is 10 hours).
  • The application process that calls the function is the same.
  • The logon session is the same.
  • The instance of the component is the same.

SSLCipherStrength
The minimum cipher strength used for bulk encryption
This minimum cipher strength largely dependent on the security modules installed on the system. If the cipher strength specified is not supported, an error will be returned when connections are initiated.Please note that this setting contains the minimum cipher strength requested from the security library. The actual cipher strength used for the connection is shown by the {@link ipworksssl.FtpsSSLStatusEvent SSLStatus} event.

Use this setting with caution. Requesting a lower cipher strength than necessary could potentially cause serious security vulnerabilities in your application.

When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the {@link ipworksssl.Ftps#config config setting.

SSLEnabledProtocols
Used to enable/disable the supported security protocols
Used to enable/disable the supported security protocols.Not all supported protocols are enabled by default (the value of this setting is 192). If you want more granular control over the enabled protocols, you can set this property to the binary 'OR' of one or more of the following values:
TLS1.2
3072 (Hex C00)
TLS1.1
768 (Hex 300)
TLS1
192 (Hex C0) (Default)
SSL3
48 (Hex 30)
SSL2
12 (Hex 0C)
Please note that although a number of sites still support SSL2, it is usually a good idea to disable it because of potential security vulnerabilities.

When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the {@link ipworksssl.Ftps#config config setting.

TLS 1.1 and TLS1.2 support are only available starting with Windows 7.

SSLProvider
The name of the security provider to use
Change this setting to use security providers other than the system default.Use this setting with caution. Disabling SSL security or pointing to the wrong provider could potentially cause serious security vulnerabilities in your application.

The special value "*" (default) picks the default SSL provider defined in the system.

Note: On Windows systems, the default SSL Provider is "Microsoft Unified Security Protocol Provider" and cannot be changed.

SSLSecurityFlags
Flags that control certificate verification
The following flags are defined (specified in hexadecimal notation). They can be or-ed together to exclude multiple conditions:
0x00000001
Ignore time validity status of certificate.
0x00000002
Ignore time validity status of CTL.
0x00000004
Ignore non-nested certificate times.
0x00000010
Allow unknown Certificate Authority.
0x00000020
Ignore wrong certificate usage.
0x00000100
Ignore unknown certificate revocation status.
0x00000200
Ignore unknown CTL signer revocation status.
0x00000400
Ignore unknown Certificate Authority revocation status.
0x00000800
Ignore unknown Root revocation status.
0x00008000
Allow test Root certificate.
0x00004000
Trust test Root certificate.
0x80000000
Ignore non-matching CN (certificate CN not-matching server name).
This functionality is currently not available in Java or when the provider is OpenSSL.

SSLContextProtocol
The protocol used when getting an SSLContext instance
Possible values are SSL, SSLv2, SSLv3, TLS and TLSv1. Use it only in case your security provider does not support TLS. This is the parameter "protocol" inside the SSLContext.getInstance(protocol) call.
SSLTrustManagerFactoryAlgorithm
The algorithm to be used to create a TrustManager through TrustManagerFactory
Possible values include SunX509. This is the parameter "algorithm" inside the TrustManagerFactory.getInstance(algorithm) call.
SSLEnabledCipherSuites
The cipher suite to be used in an SSL negotiation
The enabled cipher suites to be used in SSL negotiation.By default, the enabled cipher suites will include all available ciphers ("*").

The special value "*" means that the component will pick all of the supported cipher suites. If SSLEnabledCipherSuites is set to any other value, only the specified cipher suites will be considered.

Multiple cipher suites are separated by semicolons.

Example values:

 obj.config("SSLEnabledCipherSuites=*");
 obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA");
 obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA; SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA"); 
Possible values include:
  • SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
  • SSL_RSA_WITH_RC4_128_SHA
  • SSL_RSA_WITH_DES_CBC_SHA
  • SSL_RSA_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DH_anon_WITH_DES_CBC_SHA
  • SSL_RSA_EXPORT_WITH_RC4_40_MD5
  • SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DH_anon_EXPORT_WITH_RC4_40_MD5
  • SSL_DHE_DSS_WITH_DES_CBC_SHA
  • SSL_RSA_WITH_NULL_MD5
  • SSL_DH_anon_WITH_3DES_EDE_CBC_SHA
  • SSL_DHE_RSA_WITH_DES_CBC_SHA
  • SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA
  • SSL_RSA_WITH_NULL_SHA
  • SSL_DH_anon_WITH_RC4_128_MD5
  • SSL_RSA_WITH_RC4_128_MD5
  • SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
  • SSL_RSA_WITH_3DES_EDE_CBC_SHA
  • TLS_ECDH_ECDSA_WITH_NULL_SHA
  • TLS_DH_anon_WITH_AES_128_CBC_SHA256
  • TLS_ECDH_anon_WITH_RC4_128_SHA
  • TLS_DH_anon_WITH_AES_128_CBC_SHA
  • TLS_DHE_RSA_WITH_AES_128_CBC_SHA
  • TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
  • TLS_KRB5_WITH_3DES_EDE_CBC_SHA
  • TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
  • TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
  • TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
  • TLS_KRB5_EXPORT_WITH_RC4_40_SHA
  • TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDHE_RSA_WITH_RC4_128_SHA
  • TLS_ECDH_ECDSA_WITH_RC4_128_SHA
  • TLS_ECDH_anon_WITH_NULL_SHA
  • TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
  • TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  • TLS_RSA_WITH_NULL_SHA256
  • TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA
  • TLS_KRB5_WITH_RC4_128_MD5
  • TLS_ECDHE_ECDSA_WITH_NULL_SHA
  • TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
  • TLS_ECDH_RSA_WITH_RC4_128_SHA
  • TLS_EMPTY_RENEGOTIATION_INFO_SCSV
  • TLS_KRB5_WITH_3DES_EDE_CBC_MD5
  • TLS_KRB5_WITH_RC4_128_SHA
  • TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
  • TLS_ECDH_RSA_WITH_NULL_SHA
  • TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
  • TLS_KRB5_WITH_DES_CBC_MD5
  • TLS_KRB5_EXPORT_WITH_RC4_40_MD5
  • TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
  • TLS_ECDH_anon_WITH_AES_128_CBC_SHA
  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
  • TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  • TLS_KRB5_WITH_DES_CBC_SHA
  • TLS_RSA_WITH_AES_128_CBC_SHA
  • TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA
  • TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDHE_RSA_WITH_NULL_SHA
  • TLS_RSA_WITH_AES_128_CBC_SHA256
  • TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
  • TLS_DHE_DSS_WITH_AES_128_CBC_SHA

SSLEnabledCipherSuites is used together with SSLCipherStrength .

Note: This configuration setting is available only in .NET and Java.

SSLAlgorithmList
A string that controls the cipher algorithms to be used by SSL
This configuration option takes a semicolon (;) delimited list of cipher algorithms to specify what algorithms may be used by SSL. This option can be used in conjunction with SSLEnabledProtocols to control which ciphers are used.For example:
 obj.Config("SSLEnabledProtocols=3072"); // TLS1.2  (supports SHA_256)
   obj.Config("SSLAlgorithmList=CALG_SHA_256;CALG_MD5"); 
Possible values include:
  • CALG_3DES
  • CALG_3DES_112
  • CALG_AES
  • CALG_AES_128
  • CALG_AES_192
  • CALG_AES_256
  • CALG_AGREEDKEY_ANY
  • CALG_CYLINK_MEK
  • CALG_DES
  • CALG_DESX
  • CALG_DH_EPHEM
  • CALG_DH_SF
  • CALG_DSS_SIGN
  • CALG_ECDH
  • CALG_ECDSA
  • CALG_ECMQV
  • CALG_HASH_REPLACE_OWF
  • CALG_HUGHES_MD5
  • CALG_HMAC
  • CALG_KEA_KEYX
  • CALG_MAC
  • CALG_MD2
  • CALG_MD4
  • CALG_MD5
  • CALG_NO_SIGN
  • CALG_OID_INFO_CNG_ONLY
  • CALG_OID_INFO_PARAMETERS
  • CALG_PCT1_MASTER
  • CALG_RC2
  • CALG_RC4
  • CALG_RC5
  • CALG_RSA_KEYX
  • CALG_RSA_SIGN
  • CALG_SCHANNEL_ENC_KEY
  • CALG_SCHANNEL_MAC_KEY
  • CALG_SCHANNEL_MASTER_HASH
  • CALG_SEAL
  • CALG_SHA
  • CALG_SHA1
  • CALG_SHA_256
  • CALG_SHA_384
  • CALG_SHA_512
  • CALG_SKIPJACK
  • CALG_SSL2_MASTER
  • CALG_SSL3_MASTER
  • CALG_SSL3_SHAMD5
  • CALG_TEK
  • CALG_TLS1_MASTER
  • CALG_TLS1PRF

This option is only valid in Windows.

Socket Configuration Settings

AbsoluteTimeout
Determines whether timeouts are inactivity timeouts or absolute timeouts
If AbsoluteTimeout is set to True, any method which does not complete within Timeout seconds will be aborted. By default, AbsoluteTimeout is False, and the timeout is an inactivity timeout.Note: This option is not valid for UDP ports.

FirewallData
Used to send extra data to the firewall
When the firewall is a tunneling proxy, use this property to send custom (additional) headers to the firewall (e.g. headers for custom authentication schemes).
InBufferSize
The size in bytes of the incoming queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be receiving. Increasing the value of the InBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the InBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

OutBufferSize
The size in bytes of the outgoing queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be sending. Increasing the value of the OutBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the OutBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

Base Configuration Settings

GUIAvailable
Tells the bean whether or not a message loop is available for processing events
In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The bean will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.In some non-GUI applications an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GuiAvailable to false will ensure that the bean does not attempt to process external events.

UseDaemonThreads
Whether threads created by the bean are daemon threads
If set to True, when the bean creates a thread the thread's Daemon property will be explicitly set to True. By default this setting is False and the bean will not set the Daemon property on the created thread.

Throws:
IPWorksSSLException

deleteFile

public void deleteFile(java.lang.String fileName)
                throws IPWorksSSLException
Remove a file specified by FileName from an FTP server.

This method is used to remove a file specified by FileName from an FTP server. The remote file or directory specified by FileName is deleted. FileName is either an absolute path on the server, or a path relative to RemotePath . If there is no FTP session in place, one is automatically created by first calling the Logon method.

Throws:
IPWorksSSLException

doEvents

public void doEvents()
              throws IPWorksSSLException
Processes events from the internal message queue.

When DoEvents is called, the bean processes any available events. If no events are available, it waits for a preset period of time, and then returns.

Throws:
IPWorksSSLException

download

public void download()
              throws IPWorksSSLException
Download a RemoteFile from an FTP server.

This method is used to download the remote file specified by RemoteFile to the local file specified by LocalFile , or it is retrieved through the Transfer event if the LocalFile property is "" (empty string). RemoteFile is either an absolute path on the server, or a path relative to RemotePath . If there is no FTP session in place, one is automatically created by first calling the Logon method.

Example (Download a File)

 FTPControl.LocalFile = "C:\localfile.txt"
 FTPControl.RemoteFile = "remotefile.txt"
 FTPControl.Download()
 
 FTPControl.LocalFile = "C:\localfile2.txt"
 FTPControl.RemoteFile = "folder/remotefile2.txt"
 FTPControl.Download() 

Throws:
IPWorksSSLException

interrupt

public void interrupt()
               throws IPWorksSSLException
Interrupt the current method.

If there is no method in progress, Interrupt simply returns, doing nothing.

Throws:
IPWorksSSLException

listDirectory

public void listDirectory()
                   throws IPWorksSSLException
List the current directory specified by RemotePath on an FTP server.

This method is used to list the directory (or file mask) specified in RemoteFile . RemoteFile is either an absolute path on the server, or a path relative to RemotePath . The file listing is received through the DirList event.

Similar to ListDirectoryLong , except only file names are returned.

Note that since RemoteFile acts as a file mask, to retrieve a complete directory listing RemoteFile should be set to empty string or a mask like "*". If there is no FTP session in place, one is automatically created by first calling the Logon method.

Throws:
IPWorksSSLException

listDirectoryLong

public void listDirectoryLong()
                       throws IPWorksSSLException
List extended directory information for RemotePath .

This method is used to request a directory (or file mask) listing specified in RemoteFile . RemoteFile is either an absolute path on the server, or a path relative to RemotePath . The file listing is received through the DirList event. Extended file information is returned.

Note that since RemoteFile acts as a file mask, to retrieve a complete directory listing RemoteFile should be set to empty string or a mask like "*". If there is no FTP session in place, one is automatically created by first calling the Logon method.

Throws:
IPWorksSSLException

logoff

public void logoff()
            throws IPWorksSSLException
Logoff from the FTP server by posting a QUIT command.

This method is used to logoff from the FTP server by posting a QUIT command. If that fails, the connection is terminated by the local host.

Throws:
IPWorksSSLException

logon

public void logon()
           throws IPWorksSSLException
Logon to the FTP RemoteHost using the current User and Password .

This method is used to logon to the FTP server using the current User and Password . If TransferMode is not 0 (Default), then the FTP transfer mode is set to the appropriate value.

Example (Logging On)

 FTPControl.RemoteHost = "ftpserver"
 FTPControl.User = "username"
 FTPControl.Password = "password"
 FTPControl.Logon() 

Throws:
IPWorksSSLException

makeDirectory

public void makeDirectory(java.lang.String newDir)
                   throws IPWorksSSLException
Create a directory on an FTP server.

This method is used to create a directory with path specified by NewDir on the FTP server. NewDir is either an absolute path on the server, or a path relative to RemotePath . If there is no FTP session in place, one is automatically created by first calling the Logon method.Note that when MakeDirectory is called, RemoteFile is changed to NewDir .

Throws:
IPWorksSSLException

removeDirectory

public void removeDirectory(java.lang.String dirName)
                     throws IPWorksSSLException
Remove a directory specified by DirName from an FTP server.

This property is used to remove a directory with path specified by DirName from the FTP server. DirName is either an absolute path on the server, or a path relative to RemotePath . If there is no FTP session in place, one is automatically created by first calling the Logon method.

Throws:
IPWorksSSLException

renameFile

public void renameFile(java.lang.String newName)
                throws IPWorksSSLException
Change the name of RemoteFile to NewName .

This property is used to change the name of a remote file, specified by RemoteFile to NewName . RemoteFile and NewName are either absolute paths on the server, or a path relative to RemotePath . If there is no FTP session in place, one is automatically created by first calling the Logon method.

Throws:
IPWorksSSLException

setDownloadStream

public void setDownloadStream(java.io.OutputStream downloadStream)
                       throws IPWorksSSLException
Sets the stream to which the downloaded data from the server will be written.

This method is used to set the stream to which the downloaded data from the server will be written. If a download stream is set before the Download method is called, the downloaded data will be written to the stream. The stream should be open and normally set to position 0. The bean will automatically close this stream if ipworksssl.Ftps#config is true (default). If the stream is closed, you will need to call {@link ipworksssl.Ftps#setDownloadStream SetDownloadStream} again before calling {@link ipworksssl.Ftps#download Download} again. The downloaded content will be written starting at the current position in the stream. If {@link ipworksssl.Ftps#getStartByte StartByte} is non zero the server will be instructed to skip those bytes before starting to send the content of the file so it is up to you to build the stream appropriately in that case.

Note: {@link ipworksssl.Ftps#setDownloadStream SetDownloadStream} and {@link ipworksssl.Ftps#getLocalFile LocalFile} will reset the other.

Throws:
IPWorksSSLException

setUploadStream

public void setUploadStream(java.io.InputStream uploadStream)
                     throws IPWorksSSLException
Sets the stream from which the bean will read data to upload to the server.

This method is used to set the stream from which the bean will read data to upload to the server. If an upload stream is set before the Upload method is called, the content of the stream will be read by the bean and uploaded to the server. The stream should be open and normally set to position 0. The bean will automatically close this stream if ipworksssl.Ftps#config is true (default). If the stream is closed, you will need to call {@link ipworksssl.Ftps#setUploadStream SetUploadStream} again before calling {@link ipworksssl.Ftps#upload Upload} again. The content of the stream will be read from the current position all the way to the end and no bytes will be skipped even if {@link ipworksssl.Ftps#getStartByte StartByte} is set to a non zero value (though the server will be instructed to skip those bytes in its file).

Note: {@link ipworksssl.Ftps#setUploadStream SetUploadStream} and {@link ipworksssl.Ftps#getLocalFile LocalFile} will reset the other.

Throws:
IPWorksSSLException

storeUnique

public void storeUnique()
                 throws IPWorksSSLException
Upload a file with a Unique Name to an FTP server.

This method is used to upload a file with a Unique Name to an FTP server. Similar to the Upload method but the server determines a unique name for the LocalFile to be saved on the current directory given by RemotePath . The server includes the new name of the file in its response. The user should check the PITrail event, or LastReply property to retrieve this generated filename.

Throws:
IPWorksSSLException

upload

public void upload()
            throws IPWorksSSLException
Upload a file specified by LocalFile to an FTP server.

This method uploads a local file specified by LocalFile to the remote file specified by RemoteFile . RemoteFile is either an absolute path on the server, or a path relative to RemotePath . If there is no FTP session in place, one is automatically created by first calling the Logon method.

If you want to append to a server file, please refer to the Append method.

Example (Upload a File)

 FTPControl.LocalFile = "C:\localfile.txt"
 FTPControl.RemoteFile = "remotefile.txt"
 FTPControl.Upload()
 
 FTPControl.LocalFile = "C:\localfile2.txt"
 FTPControl.RemoteFile = "folder/remotefile2.txt"
 FTPControl.Upload() 

Throws:
IPWorksSSLException

addFtpsEventListener

public void addFtpsEventListener(FtpsEventListener l)
                          throws java.util.TooManyListenersException
Throws:
java.util.TooManyListenersException

removeFtpsEventListener

public void removeFtpsEventListener(FtpsEventListener l)

IP*Works! SSL V9

Copyright (c) 2015 /n software inc. - All rights reserved.