gnu.inet.ftp
Class ActivePutter

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--gnu.inet.ftp.Putter
              |
              +--gnu.inet.ftp.ActivePutter
All Implemented Interfaces:
ConnectionEventSource, java.lang.Runnable, TransferEventSource

public class ActivePutter
extends Putter

This class implements an FTP-style data connection server thread for PUTing in a non-passive files/data.

This class is used internally to the FtpClient class.


Fields inherited from class gnu.inet.ftp.Putter
BUFFER_SIZE, cancelled, connectionListeners, istream, mode, transferListeners, type
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ActivePutter(java.io.InputStream in)
          Create a new ActivePutter thread given the InputStream data source.
 
Method Summary
 java.net.InetAddress getInetAddress()
          get address that this Putter is listening on
 int getPort()
          get the port this ActivePutter is listening on
 void run()
          implements thread behavior.
 void setTimeout(int milliseconds)
          set connection timeout in milliseconds.
 
Methods inherited from class gnu.inet.ftp.Putter
addConnectionListener, addConnectionListeners, addTransferListener, addTransferListeners, cancel, removeConnectionListener, removeTransferListener, setDebug, setInputStream, setMode, setType, signalConnectionClosed, signalConnectionFailed, signalConnectionOpened, signalTransferCompleted, signalTransfered, signalTransferStarted, 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, 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
 

Constructor Detail

ActivePutter

public ActivePutter(java.io.InputStream in)
             throws java.io.IOException
Create a new ActivePutter thread given the InputStream data source.
Parameters:
in - data source
Throws:
java.io.IOException - io error with the ServerSocket
Method Detail

getPort

public int getPort()
get the port this ActivePutter is listening on
Returns:
port number

getInetAddress

public java.net.InetAddress getInetAddress()
get address that this Putter is listening on
Returns:
server socket IP address

setTimeout

public void setTimeout(int milliseconds)
set connection timeout in milliseconds. must be called before start()/run()
Parameters:
milliseconds - the number of milliseconds the server socket should wait for a connection before timing-out. the default timeout is 30s

run

public void run()
implements thread behavior. Put data to server using given parameters.
Overrides:
run in class java.lang.Thread