com.glub.secureftp.bean
Class FTPRead

java.lang.Object
  extended by com.glub.secureftp.bean.FTPRead
All Implemented Interfaces:
FTPData

public class FTPRead
extends Object
implements FTPData

The FTPRead class is responsible for reading data from the FTP server.

Since:
2.5.19
Version:
$Revision: 47 $, $Date: 2009-05-16 10:10:12 -0700 (Sat, 16 May 2009) $

Constructor Summary
FTPRead(ServerSocket ss, OutputStream os)
          Create a new FTPRead object to be used to retrieve binary data actively.
FTPRead(ServerSocket ss, OutputStream os, Progress p, long start, long stop)
          Create a new FTPRead object to be used to retrieve binary data with progress information actively.
FTPRead(ServerSocket ss, PrintWriter w)
          Create a new FTPRead object to be used to retrieve ascii data actively.
FTPRead(ServerSocket ss, PrintWriter w, Progress p, long start, long stop)
          Create a new FTPRead object to be used to retrieve ascii data with progress information actively.
FTPRead(ServerSocket ss, PrintWriter w, Progress p, long start, long stop, String e)
          Create a new FTPRead object to be used to retrieve ascii data with progress information actively.
FTPRead(Socket s, OutputStream os)
          Create a new FTPRead object to be used to retrieve binary data passively.
FTPRead(Socket s, OutputStream os, Progress p, long start, long stop)
          Create a new FTPRead object to be used to retrieve binary data with progress information passively.
FTPRead(Socket s, PrintWriter w)
          Create a new FTPRead object to be used to retrieve ascii data passively.
FTPRead(Socket s, PrintWriter w, Progress p, long start, long stop)
          Create a new FTPRead object to be used to retrieve ascii data with progress information passively.
FTPRead(Socket s, PrintWriter w, Progress p, long start, long stop, String e)
          Create a new FTPRead object to be used to retrieve ascii data with progress information passively.
 
Method Summary
 void abortComplete()
          Called when an aborted transfer is complete.
 void abortTransfer()
          Abort the data transfer.
protected  void cleanup()
          Housekeeping for the data socket.
 void doTransfer()
          Handle the data transfer.
 Socket getControlSocket()
          Get the control socket (used for abort).
 void setControlSocket(Socket control)
          Set the control socket (used for abort).
 void setZLibCompressed(boolean compressed)
          Set stream as zLib compressed (mode z).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPRead

public FTPRead(Socket s,
               OutputStream os)
Create a new FTPRead object to be used to retrieve binary data passively.

Parameters:
s - the data socket.
os - the data stream.

FTPRead

public FTPRead(Socket s,
               OutputStream os,
               Progress p,
               long start,
               long stop)
Create a new FTPRead object to be used to retrieve binary data with progress information passively.

Parameters:
s - the data socket.
os - the data stream.
p - a Progress object which is used to update download status.
start - the start size of the file being downloaded (used in progress).
stop - the stop size of the file being downloaded (used in progress).

FTPRead

public FTPRead(Socket s,
               PrintWriter w)
Create a new FTPRead object to be used to retrieve ascii data passively.

Parameters:
s - the data socket.
w - the data writer.

FTPRead

public FTPRead(Socket s,
               PrintWriter w,
               Progress p,
               long start,
               long stop)
Create a new FTPRead object to be used to retrieve ascii data with progress information passively.

Parameters:
s - the data socket.
w - the data writer.
p - a Progress object which is used to update download status.
start - the start size of the file being downloaded (used in progress).
stop - the stop size of the file being downloaded (used in progress).

FTPRead

public FTPRead(Socket s,
               PrintWriter w,
               Progress p,
               long start,
               long stop,
               String e)
Create a new FTPRead object to be used to retrieve ascii data with progress information passively.

Parameters:
s - the data socket.
w - the data writer.
p - a Progress object which is used to update download status.
start - the start size of the file being downloaded (used in progress).
stop - the stop size of the file being downloaded (used in progress).
e - the data encoding.

FTPRead

public FTPRead(ServerSocket ss,
               OutputStream os)
Create a new FTPRead object to be used to retrieve binary data actively.

Parameters:
ss - the data server socket.
os - the data stream.

FTPRead

public FTPRead(ServerSocket ss,
               OutputStream os,
               Progress p,
               long start,
               long stop)
Create a new FTPRead object to be used to retrieve binary data with progress information actively.

Parameters:
ss - the data server socket.
os - the data stream.
p - a Progress object which is used to update download status.
start - the start size of the file being downloaded (used in progress).
stop - the stop size of the file being downloaded (used in progress).

FTPRead

public FTPRead(ServerSocket ss,
               PrintWriter w)
Create a new FTPRead object to be used to retrieve ascii data actively.

Parameters:
ss - the data server socket.
w - the data writer.

FTPRead

public FTPRead(ServerSocket ss,
               PrintWriter w,
               Progress p,
               long start,
               long stop)
Create a new FTPRead object to be used to retrieve ascii data with progress information actively.

Parameters:
ss - the data server socket.
w - the data writer.
p - a Progress object which is used to update download status.
start - the start size of the file being downloaded (used in progress).
stop - the stop size of the file being downloaded (used in progress).

FTPRead

public FTPRead(ServerSocket ss,
               PrintWriter w,
               Progress p,
               long start,
               long stop,
               String e)
Create a new FTPRead object to be used to retrieve ascii data with progress information actively.

Parameters:
ss - the data server socket.
w - the data writer.
p - a Progress object which is used to update download status.
start - the start size of the file being downloaded (used in progress).
stop - the stop size of the file being downloaded (used in progress).
e - the data encoding.
Method Detail

setZLibCompressed

public void setZLibCompressed(boolean compressed)
Set stream as zLib compressed (mode z).

Parameters:
compressed - true if compressed

setControlSocket

public void setControlSocket(Socket control)
Set the control socket (used for abort).

Specified by:
setControlSocket in interface FTPData
Parameters:
control - the control socket

getControlSocket

public Socket getControlSocket()
Get the control socket (used for abort).

Specified by:
getControlSocket in interface FTPData
Returns:
the control socket.

doTransfer

public void doTransfer()
                throws FTPException
Handle the data transfer.

Specified by:
doTransfer in interface FTPData
Throws:
FTPException - if the FTP server returns an error.

abortTransfer

public void abortTransfer()
                   throws FTPException
Abort the data transfer.

Specified by:
abortTransfer in interface FTPData
Throws:
FTPException - if the FTP server returns an error.

abortComplete

public void abortComplete()
Called when an aborted transfer is complete. This should not be called directly.

Specified by:
abortComplete in interface FTPData

cleanup

protected void cleanup()
Housekeeping for the data socket.



Copyright © 2000-08 Glub Tech, Inc. All Rights Reserved.