public class SocketConnection extends java.lang.Object implements FtpConnection
| Constructor and Description |
|---|
SocketConnection() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes open connection.
|
java.lang.String |
getHost()
Returns current host name.
|
java.io.InputStream |
getInputStream()
Returns connection input stream.
|
java.io.OutputStream |
getOutputStream()
Returns connection output stream.
|
java.net.ServerSocket |
getServerSocket() |
java.net.Socket |
getSocket() |
boolean |
isOpen()
Checks if connection is open.
|
void |
openIncoming(int timeout,
int linger)
Opens incoming connection.
|
void |
openIncoming(int timeout,
int linger,
boolean keepAlive)
Opens incoming connection.
|
void |
openOutgoing(java.lang.String host,
int port,
int timeout,
boolean keepAlive,
boolean tcpNoDelay,
int linger,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUserId,
java.lang.String proxyPassword,
java.lang.String proxyType)
Opens outgoing connection.
|
void |
openOutgoing(java.lang.String host,
int port,
int timeout,
int linger)
Opens outgoing connection.
|
void |
openOutgoing(java.lang.String host,
int port,
int timeout,
int linger,
boolean keepAlive,
boolean tcpNoDelay)
Opens outgoing connection.
|
void |
openOutgoing(java.lang.String host,
int port,
int timeout,
int linger,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUserId,
java.lang.String proxyPassword,
java.lang.String proxyType)
Opens outgoing connection.
|
void |
prepareIncoming(com.jscape.inet.util.ServerSocketUtil.PortRange range,
int timeout)
Prepares incoming connection.
|
void |
setCompression(boolean compression)
Sets whether the sockets stream will be wrapped into Deflatered
and Inflatered streams.
|
void |
setReceiveBufferSize(int receiveBufferSize)
Sets the receive buffer size option of the ftp connection.
|
void |
setSendBufferSize(int sendBufferSize)
Sets the send buffer size option of the ftp connection.
|
java.lang.String |
toString() |
public void prepareIncoming(com.jscape.inet.util.ServerSocketUtil.PortRange range,
int timeout)
throws FtpException
prepareIncoming in interface FtpConnectionrange - data port rangetimeout - connection timeout.FtpException - if an I/O error occurs.public java.net.ServerSocket getServerSocket()
public java.net.Socket getSocket()
public void openIncoming(int timeout,
int linger,
boolean keepAlive)
throws FtpException
timeout - connection timeout.keepAlive - keep alive.FtpException - if an I/O error occurs.public void openIncoming(int timeout,
int linger)
throws FtpException
openIncoming in interface FtpConnectiontimeout - connection timeout.FtpException - if an I/O error occurs.public void openOutgoing(java.lang.String host,
int port,
int timeout,
int linger,
boolean keepAlive,
boolean tcpNoDelay)
throws FtpException
openOutgoing in interface FtpConnectionhost - host to connectport - port to connecttimeout - connection timeoutkeepAlive - keep aliveFtpException - if an I/O error occurs.public void openOutgoing(java.lang.String host,
int port,
int timeout,
int linger)
throws FtpException
host - host to connectport - port to connecttimeout - connection timeoutFtpException - if an I/O error occurs.public void openOutgoing(java.lang.String host,
int port,
int timeout,
boolean keepAlive,
boolean tcpNoDelay,
int linger,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUserId,
java.lang.String proxyPassword,
java.lang.String proxyType)
throws FtpException
openOutgoing in interface FtpConnectionhost - host to connectport - port to connecttimeout - connection timeoutkeepAlive - keep alivelinger - how long to linger forproxyHost - Proxy host serverproxyPort - Proxy portproxyUserId - Proxy user nameproxyPassword - Proxy user passwordproxyType - Valid proxy type: HTTP, SOCKS5FtpException - if an I/O error occurs.public void openOutgoing(java.lang.String host,
int port,
int timeout,
int linger,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUserId,
java.lang.String proxyPassword,
java.lang.String proxyType)
throws FtpException
host - host to connectport - port to connecttimeout - connection timeoutlinger - how long to linger forproxyHost - Proxy host serverproxyPort - Proxy portproxyUserId - Proxy user nameproxyPassword - Proxy user passwordproxyType - Valid proxy type: HTTP, SOCKS5FtpException - if an I/O error occurs.public void close()
close in interface FtpConnectionpublic boolean isOpen()
isOpen in interface FtpConnectiontrue if connection is open.public java.io.InputStream getInputStream()
throws FtpException
getInputStream in interface FtpConnectionFtpException - an I/O error occurs.public java.io.OutputStream getOutputStream()
throws FtpException
getOutputStream in interface FtpConnectionFtpException - an I/O error occurs.public java.lang.String getHost()
getHost in interface FtpConnectionpublic void setCompression(boolean compression)
setCompression in interface FtpConnectionpublic void setSendBufferSize(int sendBufferSize)
setSendBufferSize in interface FtpConnectionsendBufferSize - Send buffer size.public void setReceiveBufferSize(int receiveBufferSize)
setReceiveBufferSize in interface FtpConnectionreceiveBufferSize - Receive buffer size.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © JSCAPE LLC. 1999-2021. All Rights Reserved