f00f.net.irc.martyr.dcc
Class DccSendHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--f00f.net.irc.martyr.dcc.DccSendHandler
All Implemented Interfaces:
java.lang.Runnable

public class DccSendHandler
extends java.lang.Thread

A DccSendHandler manages a DCC "send" (to us) file transfer. If you wish to use this class to handle a DCC session, provide an implementation for getStreamForReceive in a subclass.

See Also:
AutoDccSetup.getDccSendHandler(java.net.Socket, java.lang.String, int), DccTestBot, getStreamForReceive(java.lang.String, int)

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DccSendHandler(java.net.Socket socket, java.lang.String filename, int filesize)
           
 
Method Summary
protected  java.io.OutputStream getStreamForReceive(java.lang.String filename, int filesize)
          This method should return an output stream that a file can be placed into.
protected  void handleDccSend(java.net.Socket socket, java.lang.String filename, int filesize)
          A call to this method means that a connection has been established and processing the file should commence.
 void run()
           
 
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, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DccSendHandler

public DccSendHandler(java.net.Socket socket,
                      java.lang.String filename,
                      int filesize)
Method Detail

handleDccSend

protected void handleDccSend(java.net.Socket socket,
                             java.lang.String filename,
                             int filesize)
                      throws java.io.IOException
A call to this method means that a connection has been established and processing the file should commence. Note that normally one would not override this method, but rather, override getStreamForReceive.
See Also:
getStreamForReceive(java.lang.String, int)

getStreamForReceive

protected java.io.OutputStream getStreamForReceive(java.lang.String filename,
                                                   int filesize)
                                            throws java.io.IOException
This method should return an output stream that a file can be placed into. Default implementation throws a FileNotFoundException. This is the only method you must override (in this class) to provide fully functional DCC file transfers.

run

public void run()
Overrides:
run in class java.lang.Thread


Copyright © 2000,2001,2002,2003 f00f networks.