|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.sauronsoftware.ftp4j.FTPConnector
public abstract class FTPConnector
This abstract class is the base for creating a connector. Connectors are used by the client to establish connections with remote servers.
Field Summary | |
---|---|
protected int |
closeTimeout
Timeout in seconds for connection regular closing. |
protected int |
connectionTimeout
Timeout in seconds for connection enstablishing. |
protected int |
readTimeout
Timeout in seconds for read operations. |
Constructor Summary | |
---|---|
protected |
FTPConnector()
Builds the connector. |
protected |
FTPConnector(boolean useSuggestedAddressForDataConnectionsDefValue)
Builds the connector. |
Method Summary | |
---|---|
void |
abortConnectForCommunicationChannel()
Aborts an ongoing connection attempt for a communication channel. |
abstract java.net.Socket |
connectForCommunicationChannel(java.lang.String host,
int port)
This methods returns an established connection to a remote host, suitable for a FTP communication channel. |
abstract java.net.Socket |
connectForDataTransferChannel(java.lang.String host,
int port)
This methods returns an established connection to a remote host, suitable for a FTP data transfer channel. |
void |
setCloseTimeout(int closeTimeout)
Sets the timeout for close operations. |
void |
setConnectionTimeout(int connectionTimeout)
Sets the timeout for connection operations. |
void |
setReadTimeout(int readTimeout)
Sets the timeout for read operations. |
void |
setUseSuggestedAddressForDataConnections(boolean value)
This flag determines the behavior of the connector when it has to open a connection toward the server to perform a passive data transfer. |
protected java.net.Socket |
tcpConnectForCommunicationChannel(java.lang.String host,
int port)
Creates a socket and connects it to the given host for a communication channel. |
protected java.net.Socket |
tcpConnectForDataTransferChannel(java.lang.String host,
int port)
Creates a socket and connects it to the given host for a data transfer channel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int connectionTimeout
protected int readTimeout
protected int closeTimeout
Constructor Detail |
---|
protected FTPConnector(boolean useSuggestedAddressForDataConnectionsDefValue)
useSuggestedAddressForDataConnectionsDefValue
- The connector's default value for the
useSuggestedAddressForDataConnections flag.setUseSuggestedAddressForDataConnections(boolean)
protected FTPConnector()
Method Detail |
---|
public void setConnectionTimeout(int connectionTimeout)
connectionTimeout
- The timeout value in seconds.public void setReadTimeout(int readTimeout)
readTimeout
- The timeout value in seconds.public void setCloseTimeout(int closeTimeout)
closeTimeout
- The timeout value in seconds.public void setUseSuggestedAddressForDataConnections(boolean value)
FTPClient.connect(String)
and
FTPClient.connect(String, int)
methods). In this case, the
response to the PASV command is used only to determinate the port for the
connection.
The default value for this flag (the one used if you never the method is
never called) depends on:
value
- The value for the flag.protected java.net.Socket tcpConnectForCommunicationChannel(java.lang.String host, int port) throws java.io.IOException
connectionTimeout
, readTimeout
and closeTimeout
.
If you are extending FTPConnector, consider using this method to
establish your socket connection for the communication channel, instead
of creating Socket objects, since it is already aware of the timeout
values possibly given by the caller. Moreover the caller can abort
connection calling FTPClient.abortCurrentConnectionAttempt()
.
host
- The host for the connection.port
- The port for the connection.
java.io.IOException
- If connection fails.protected java.net.Socket tcpConnectForDataTransferChannel(java.lang.String host, int port) throws java.io.IOException
connectionTimeout
, readTimeout
and closeTimeout
.
If you are extending FTPConnector, consider using this method to
establish your socket connection for the communication channel, instead
of creating Socket objects, since it is already aware of the timeout
values possibly given by the caller.
host
- The host for the connection.port
- The port for the connection.
java.io.IOException
- If connection fails.public void abortConnectForCommunicationChannel()
public abstract java.net.Socket connectForCommunicationChannel(java.lang.String host, int port) throws java.io.IOException
host
- The remote host name or address.port
- The remote port.
java.io.IOException
- If the connection cannot be established.public abstract java.net.Socket connectForDataTransferChannel(java.lang.String host, int port) throws java.io.IOException
host
- The remote host name or address.port
- The remote port.
java.io.IOException
- If the connection cannot be established.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |