Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.enterprisedt.net.ftp
Class FTPDataSocket  view FTPDataSocket download FTPDataSocket.java

java.lang.Object
  extended bycom.enterprisedt.net.ftp.FTPDataSocket

public class FTPDataSocket
extends java.lang.Object

Supports client-side FTP DataSocket in Passive and Active Mode. Wrapper for Socket and ServerSocket. Methods are package access only - not for public use.

Version:
$Revision: 1.1 $

Field Summary
private  java.net.ServerSocket activeSocket
          The underlying socket for Active connection.
private  java.net.Socket passiveSocket
          The underlying socket for PASV connection or Socket acepted from server.
 
Constructor Summary
(package private) FTPDataSocket(java.net.ServerSocket s)
          Create socket wrapper for Active connection.
(package private) FTPDataSocket(java.net.Socket s)
          Create socket pper for PASV connection.
 
Method Summary
(package private)  void close()
          Closes underlying sockets.
(package private)  java.io.InputStream getInputStream()
          If active mode, accepts the FTP server's connection - in PASV, we are already connected.
(package private)  java.io.OutputStream getOutputStream()
          If active mode, accepts the FTP server's connection - in PASV, we are already connected.
(package private)  void setTimeout(int millis)
          Set the TCP timeout on the underlying control socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activeSocket

private java.net.ServerSocket activeSocket
The underlying socket for Active connection.


passiveSocket

private java.net.Socket passiveSocket
The underlying socket for PASV connection or Socket acepted from server.

Constructor Detail

FTPDataSocket

FTPDataSocket(java.net.ServerSocket s)
Create socket wrapper for Active connection.


FTPDataSocket

FTPDataSocket(java.net.Socket s)
Create socket pper for PASV connection.

Method Detail

setTimeout

void setTimeout(int millis)
          throws java.io.IOException
Set the TCP timeout on the underlying control socket. If a timeout is set, then any operation which takes longer than the timeout value will be killed with a java.io.InterruptedException.


getOutputStream

java.io.OutputStream getOutputStream()
                               throws java.io.IOException
If active mode, accepts the FTP server's connection - in PASV, we are already connected. Then gets the output stream of the connection


getInputStream

java.io.InputStream getInputStream()
                             throws java.io.IOException
If active mode, accepts the FTP server's connection - in PASV, we are already connected. Then gets the input stream of the connection


close

void close()
     throws java.io.IOException
Closes underlying sockets.