|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--gnu.inet.ftp.Getter
This class serves as a superclass to the ActiveGetter and PassiveGetter classes, providing a common interface and data members.
This class is used internally to the FtpClient class.
| Field Summary | |
static int |
BUFFER_SIZE
|
protected boolean |
cancelled
|
protected java.util.Vector |
connectionListeners
|
protected char |
mode
|
protected java.io.OutputStream |
ostream
|
protected java.util.Vector |
transferListeners
|
protected char |
type
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
Getter()
set the Getter initial state with debugging disabled. |
|
| Method Summary | |
void |
addConnectionListener(ConnectionListener listener)
add a ConnectionListener to the list of connectionListeners |
void |
addConnectionListeners(java.util.Vector listeners)
add a set of ConnectionListener to the list of connectionListeners |
void |
addTransferListener(TransferListener listener)
add a TransferListener to the list of transfer listeners. |
void |
addTransferListeners(java.util.Vector listeners)
add a set of TransferListener to the list of transfer listeners |
void |
cancel()
cancel a running transfer sets a flag and calls interrupt() can only be called once |
void |
removeConnectionListener(ConnectionListener listener)
De-register a ConnectionListener from the event source. |
void |
removeTransferListener(TransferListener listener)
De-register a TransferListener from the event source. |
void |
setDebug(boolean value)
Sets the ConsoleLogger's debug output. |
void |
setMode(char mode)
set the mode value |
void |
setOutputStream(java.io.OutputStream ostream)
set the OutputStream to be used for data storage |
void |
setType(char type)
set the type value |
protected void |
signalConnectionClosed(ConnectionEvent event)
signal that a connection has been closed |
protected void |
signalConnectionFailed(java.lang.Exception exception)
signal that a connection has encountered an error |
protected void |
signalConnectionOpened(ConnectionEvent event)
signal that a connection has been opened |
protected void |
signalTransferCompleted()
signal that a transfer has completed |
protected void |
signalTransfered(long amount)
signal that a transfer has completed |
protected void |
signalTransferStarted()
signal that a transfer has begun |
void |
start()
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int BUFFER_SIZE
protected java.io.OutputStream ostream
protected boolean cancelled
protected java.util.Vector connectionListeners
protected java.util.Vector transferListeners
protected char mode
protected char type
| Constructor Detail |
public Getter()
| Method Detail |
public void setOutputStream(java.io.OutputStream ostream)
ostream - the OutputStream to write data topublic void setMode(char mode)
mode - the new mode value. Valid values (MODE_*) can be found in the FtpClientProtocol class.FtpClientProtocolpublic void setType(char type)
type - the new type value. Valid values (TYPE_*) can be found in the FtpClientProtocol class.FtpClientProtocolpublic void setDebug(boolean value)
value - new debug flag valuepublic void cancel()
public void start()
start in class java.lang.Threadpublic void addConnectionListener(ConnectionListener listener)
addConnectionListener in interface ConnectionEventSourcelistener - the ConnectionListener to add to the listpublic void addConnectionListeners(java.util.Vector listeners)
addConnectionListeners in interface ConnectionEventSourcelisteners - the ConnectionListeners to add to the listpublic void removeConnectionListener(ConnectionListener listener)
removeConnectionListener in interface ConnectionEventSourcelistener - the ConnectionListener to de-registerpublic void addTransferListener(TransferListener listener)
addTransferListener in interface TransferEventSourcelistener - the TransferListener to add to the listpublic void addTransferListeners(java.util.Vector listeners)
addTransferListeners in interface TransferEventSourcelisteners - the TransferListeners to add to the listpublic void removeTransferListener(TransferListener listener)
removeTransferListener in interface TransferEventSourcelistener - the TransferListener to de-registerprotected void signalConnectionOpened(ConnectionEvent event)
event - the event to distribute to each ConnectionListenerprotected void signalConnectionClosed(ConnectionEvent event)
event - the event to distribute to each ConnectionListenerprotected void signalConnectionFailed(java.lang.Exception exception)
exception - the exception that was thrownprotected void signalTransferStarted()
protected void signalTransferCompleted()
protected void signalTransfered(long amount)
amount - the amount of data (in octets) transfered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||