Secure iNet Factory

com.jscape.inet.ftp
Class SocketConnection

java.lang.Object
  extended by com.jscape.inet.ftp.SocketConnection
All Implemented Interfaces:
FtpConnection

public class SocketConnection
extends java.lang.Object
implements FtpConnection

Socket FTP connection.


Constructor Summary
SocketConnection()
           
 
Method Summary
 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, 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)
          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(int dataPortStart, int dataPortEnd, 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketConnection

public SocketConnection()
Method Detail

prepareIncoming

public void prepareIncoming(int dataPortStart,
                            int dataPortEnd,
                            int timeout)
                     throws FtpException
Prepares incoming connection.

Specified by:
prepareIncoming in interface FtpConnection
Parameters:
dataPortStart - The start data port range.
dataPortEnd - The end data port range.
timeout - connection timeout.
Throws:
FtpException - if an I/O error occurs.

getServerSocket

public java.net.ServerSocket getServerSocket()

getSocket

public java.net.Socket getSocket()

openIncoming

public void openIncoming(int timeout,
                         int linger,
                         boolean keepAlive)
                  throws FtpException
Opens incoming connection.

Parameters:
timeout - connection timeout.
keepAlive - keep alive.
Throws:
FtpException - if an I/O error occurs.

openIncoming

public void openIncoming(int timeout,
                         int linger)
                  throws FtpException
Opens incoming connection.

Specified by:
openIncoming in interface FtpConnection
Parameters:
timeout - connection timeout.
Throws:
FtpException - if an I/O error occurs.

openOutgoing

public void openOutgoing(java.lang.String host,
                         int port,
                         int timeout,
                         int linger,
                         boolean keepAlive)
                  throws FtpException
Opens outgoing connection.

Specified by:
openOutgoing in interface FtpConnection
Parameters:
host - host to connect
port - port to connect
timeout - connection timeout
keepAlive - keep alive
Throws:
FtpException - if an I/O error occurs.

openOutgoing

public void openOutgoing(java.lang.String host,
                         int port,
                         int timeout,
                         int linger)
                  throws FtpException
Opens outgoing connection.

Parameters:
host - host to connect
port - port to connect
timeout - connection timeout
Throws:
FtpException - if an I/O error occurs.

openOutgoing

public void openOutgoing(java.lang.String host,
                         int port,
                         int timeout,
                         boolean keepAlive,
                         int linger,
                         java.lang.String proxyHost,
                         int proxyPort,
                         java.lang.String proxyUserId,
                         java.lang.String proxyPassword,
                         java.lang.String proxyType)
                  throws FtpException
Opens outgoing connection.

Specified by:
openOutgoing in interface FtpConnection
Parameters:
host - host to connect
port - port to connect
timeout - connection timeout
keepAlive - keep alive
linger - how long to linger for
proxyHost - Proxy host server
proxyPort - Proxy port
proxyUserId - Proxy user name
proxyPassword - Proxy user password
proxyType - Valid proxy type: HTTP, SOCKS5
Throws:
FtpException - if an I/O error occurs.

openOutgoing

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
Opens outgoing connection.

Parameters:
host - host to connect
port - port to connect
timeout - connection timeout
linger - how long to linger for
proxyHost - Proxy host server
proxyPort - Proxy port
proxyUserId - Proxy user name
proxyPassword - Proxy user password
proxyType - Valid proxy type: HTTP, SOCKS5
Throws:
FtpException - if an I/O error occurs.

close

public void close()
Closes open connection.

Specified by:
close in interface FtpConnection

isOpen

public boolean isOpen()
Checks if connection is open.

Specified by:
isOpen in interface FtpConnection
Returns:
true if connection is open.

getInputStream

public java.io.InputStream getInputStream()
                                   throws FtpException
Returns connection input stream.

Specified by:
getInputStream in interface FtpConnection
Returns:
connection input stream.
Throws:
FtpException - an I/O error occurs.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws FtpException
Returns connection output stream.

Specified by:
getOutputStream in interface FtpConnection
Returns:
connection output stream.
Throws:
FtpException - an I/O error occurs.

getHost

public java.lang.String getHost()
Returns current host name.

Specified by:
getHost in interface FtpConnection
Returns:
current host name.

setCompression

public void setCompression(boolean compression)
Sets whether the sockets stream will be wrapped into Deflatered and Inflatered streams.

Specified by:
setCompression in interface FtpConnection

setSendBufferSize

public void setSendBufferSize(int sendBufferSize)
Sets the send buffer size option of the ftp connection.

Specified by:
setSendBufferSize in interface FtpConnection
Parameters:
sendBufferSize - Send buffer size.

setReceiveBufferSize

public void setReceiveBufferSize(int receiveBufferSize)
Sets the receive buffer size option of the ftp connection.

Specified by:
setReceiveBufferSize in interface FtpConnection
Parameters:
receiveBufferSize - Receive buffer size.

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved