com.glub.secureftp.bean
Class FTPWrite

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

public class FTPWrite
extends Object
implements FTPData

The FTPWrite class is responsible for writing 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
FTPWrite(ServerSocket ss, BufferedReader r)
          Create a new FTPWrite object to be used to send ascii data actively.
FTPWrite(ServerSocket ss, BufferedReader r, Progress p, long start, long stop)
          Create a new FTPWrite object to be used to send ascii data with progress information actively.
FTPWrite(ServerSocket ss, BufferedReader r, Progress p, long start, long stop, String e)
          Create a new FTPWrite object to be used to send ascii data with progress information actively.
FTPWrite(ServerSocket ss, InputStream is)
          Create a new FTPWrite object to be used to send binary data actively.
FTPWrite(ServerSocket ss, InputStream is, Progress p, long start, long stop)
          Create a new FTPWrite object to be used to send binary data with progress information actively.
FTPWrite(Socket s, BufferedReader r)
          Create a new FTPWrite object to be used to send ascii data passively.
FTPWrite(Socket s, BufferedReader r, Progress p, long start, long stop)
          Create a new FTPWrite object to be used to send ascii data with progress information passively.
FTPWrite(Socket s, BufferedReader r, Progress p, long start, long stop, String e)
          Create a new FTPWrite object to be used to send ascii data with progress information passively.
FTPWrite(Socket s, InputStream is)
          Create a new FTPWrite object to be used to send binary data passively.
FTPWrite(Socket s, InputStream is, Progress p, long start, long stop)
          Create a new FTPWrite object to be used to send binary 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

FTPWrite

public FTPWrite(Socket s,
                InputStream is)
Create a new FTPWrite object to be used to send binary data passively.

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

FTPWrite

public FTPWrite(Socket s,
                InputStream is,
                Progress p,
                long start,
                long stop)
Create a new FTPWrite object to be used to send binary data with progress information passively.

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

FTPWrite

public FTPWrite(Socket s,
                BufferedReader r)
Create a new FTPWrite object to be used to send ascii data passively.

Parameters:
s - the data socket.
r - the data reader.

FTPWrite

public FTPWrite(Socket s,
                BufferedReader r,
                Progress p,
                long start,
                long stop)
Create a new FTPWrite object to be used to send ascii data with progress information passively.

Parameters:
s - the data socket.
r - the data reader.
p - a Progress object which is used to update upload status.
start - the start size of the file being uploaded (used in progress).
stop - the stop size of the file being uploaded (used in progress).

FTPWrite

public FTPWrite(Socket s,
                BufferedReader r,
                Progress p,
                long start,
                long stop,
                String e)
Create a new FTPWrite object to be used to send ascii data with progress information passively.

Parameters:
s - the data socket.
r - the data reader.
p - a Progress object which is used to update upload status.
start - the start size of the file being uploaded (used in progress).
stop - the stop size of the file being uploaded (used in progress).
e - the data encoding.

FTPWrite

public FTPWrite(ServerSocket ss,
                InputStream is)
Create a new FTPWrite object to be used to send binary data actively.

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

FTPWrite

public FTPWrite(ServerSocket ss,
                InputStream is,
                Progress p,
                long start,
                long stop)
Create a new FTPWrite object to be used to send binary data with progress information actively.

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

FTPWrite

public FTPWrite(ServerSocket ss,
                BufferedReader r)
Create a new FTPWrite object to be used to send ascii data actively.

Parameters:
ss - the data server socket.
r - the data reader.

FTPWrite

public FTPWrite(ServerSocket ss,
                BufferedReader r,
                Progress p,
                long start,
                long stop)
Create a new FTPWrite object to be used to send ascii data with progress information actively.

Parameters:
ss - the data server socket.
r - the data reader.
p - a Progress object which is used to update upload status.
start - the start size of the file being uploaded (used in progress).
stop - the stop size of the file being uploaded (used in progress).

FTPWrite

public FTPWrite(ServerSocket ss,
                BufferedReader r,
                Progress p,
                long start,
                long stop,
                String e)
Create a new FTPWrite object to be used to send ascii data with progress information actively.

Parameters:
ss - the data server socket.
r - the data reader.
p - a Progress object which is used to update upload status.
start - the start size of the file being uploaded (used in progress).
stop - the stop size of the file being uploaded (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-12 Glub Tech, Inc. All Rights Reserved.