org.elite.jdcbot.framework
Class UploadHandler

java.lang.Object
  extended by org.elite.jdcbot.framework.DCIO
      extended by org.elite.jdcbot.framework.InputThreadTarget
          extended by org.elite.jdcbot.framework.UploadHandler

public class UploadHandler
extends InputThreadTarget

Created on 26-May-08
Handels all the uploads to a single user for a session.

Since:
0.7
Version:
0.1.1
Author:
AppleGrew

Field Summary
private  boolean close
           
private  TimeoutInputThread inputThread
           
private  boolean isfirstUpload
           
private  jDCBot jdcbot
           
private  ShareManager sm
           
private  java.net.Socket socket
           
private  UploadManager um
           
private  User user
           
 
Constructor Summary
UploadHandler(User usr, java.net.Socket socket, jDCBot jdcbot, UploadManager um)
           
 
Method Summary
 void close()
           
 java.lang.String getUserName()
           
 void handleCommand(java.lang.String cmd)
          Called by InputThread when a command is read from the socket input.
 void onDisconnect()
          Called by InputThread on socket disconnection.
 void startUploads()
           
 void upload(java.lang.String cmd)
           
 
Methods inherited from class org.elite.jdcbot.framework.DCIO
parseCmdArgs, parseCmdName, parseRawCmd, ReadCommand, ReadCommand, SendCommand, SendCommand, set_IOExceptionMsg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

private java.net.Socket socket

um

private UploadManager um

jdcbot

private jDCBot jdcbot

sm

private ShareManager sm

inputThread

private TimeoutInputThread inputThread

isfirstUpload

private boolean isfirstUpload

user

private User user

close

private volatile boolean close
Constructor Detail

UploadHandler

UploadHandler(User usr,
              java.net.Socket socket,
              jDCBot jdcbot,
              UploadManager um)
Method Detail

startUploads

public void startUploads()

getUserName

public java.lang.String getUserName()

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

handleCommand

public void handleCommand(java.lang.String cmd)
Description copied from class: InputThreadTarget
Called by InputThread when a command is read from the socket input.

Overrides:
handleCommand in class InputThreadTarget
Parameters:
cmd - The raw command is passed in this argument.

upload

public void upload(java.lang.String cmd)

onDisconnect

public void onDisconnect()
Description copied from class: InputThreadTarget
Called by InputThread on socket disconnection.

Overrides:
onDisconnect in class InputThreadTarget