com.radinks.net
Class FTPConnection.DataConnection

java.lang.Object
  extended bycom.radinks.net.FTPConnection.DataConnection
Enclosing class:
FTPConnection

public class FTPConnection.DataConnection
extends java.lang.Object

Inner class that acts as an abstraction layer for Socket and ServerSocket.

Unfortunately Socket and SeverSocket do not share any ancestors. Therefore we need to create our adapter class that encloses both a ServerSocket and a Socket.

Though it's possible to obtain a Socket instance from ServerSocket by calling the accept method() it's not suitable for our work because the thread would immidiately become blocked.


Constructor Summary
FTPConnection.DataConnection()
           
 
Method Summary
 java.io.InputStream getInputStream()
          Follows the adapter pattern, returns the input stream of the server socket or client socket.
 java.io.OutputStream getOutputStream()
          returns the output stream of the client or server socket depending on whether the active or passive mode is in effect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPConnection.DataConnection

public FTPConnection.DataConnection()
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Follows the adapter pattern, returns the input stream of the server socket or client socket.

Returns:
InputStream for the data connection.
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
returns the output stream of the client or server socket depending on whether the active or passive mode is in effect.

Returns:
OutputStream for the data connection.
Throws:
java.io.IOException


Rad Inks FTP library
Copyright (c) 2003,2004 Rad Inks (Pvt) Ltd.