Secure iNet Factory

com.jscape.inet.ftp
Interface FtpConnection

All Known Implementing Classes:
SocketConnection

public interface FtpConnection

Base interface for FTP connections.


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.
 boolean isOpen()
          Checks if connection is open.
 void openIncoming(int timeout, int linger)
          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, boolean keepAlive)
          Opens outgoing connection.
 void prepareIncoming(int dataPortStart, int dataPortEnd, int timeout)
          Prepares incoming connection.
 void setCompression(boolean compression)
          Sets whether the sockets streams 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.
 

Method Detail

prepareIncoming

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

Parameters:
dataPortStart - The start data port range.
dataPortEnd - The end data port range.
timeout - connection timeout.
Throws:
FtpException - if an I/O error occurs.

openIncoming

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

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

openOutgoing

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

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

openOutgoing

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.

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.

close

void close()
Closes open connection.


isOpen

boolean isOpen()
Checks if connection is open.

Returns:
true if connection is open.

getInputStream

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

Returns:
connection input stream.
Throws:
FtpException - an I/O error occurs.

getOutputStream

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

Returns:
connection output stream.
Throws:
FtpException - an I/O error occurs.

getHost

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

Returns:
current host name.

setCompression

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


setSendBufferSize

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

Parameters:
sendBufferSize - Send buffer size.

setReceiveBufferSize

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

Parameters:
receiveBufferSize - Receive buffer size.

Secure iNet Factory

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