Babylon Java Chat

Class BabylonClientFileTransfer

java.lang.Object
  extended by java.lang.Thread
      extended by BabylonFileTransfer
          extended by BabylonClientFileTransfer
All Implemented Interfaces:
java.lang.Runnable

public class BabylonClientFileTransfer
extends BabylonFileTransfer

The thread that runs file transfers on the client side. This class inherits from the generic, abstract BabylonFileTransfer class. As the sender, it reads and uploads file blocks to the server. As the receiver, it accepts and saves incoming file blocks from the sending client, via the server.

Author:
Andy McLaughlin

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean accepted
           
protected  BabylonUser fromUser
           
 
Fields inherited from class BabylonFileTransfer
blockSize, DEFAULT_BLOCKSIZE, expireMins, expiryTime, fileName, receivedAll, receivedBlocks, tmpFile, totalBlocks, totalSize, transFile
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BabylonClientFileTransfer(BabylonPanel p, BabylonUser[] u, java.io.RandomAccessFile f, java.lang.String fn, long ts, int tb, int bs, int minutes)
           
BabylonClientFileTransfer(BabylonPanel p, BabylonUser fu, java.lang.String fn, long ts, int tb, int bs, int minutes)
           
 
Method Summary
protected  void cancel()
           
protected  void notifyAccepted(BabylonUser user, boolean acc)
           
 void run()
           
 
Methods inherited from class BabylonFileTransfer
getFileBlock, putFileBlock
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Field Detail

fromUser

protected BabylonUser fromUser

accepted

protected boolean accepted
Constructor Detail

BabylonClientFileTransfer

public BabylonClientFileTransfer(BabylonPanel p,
                                 BabylonUser[] u,
                                 java.io.RandomAccessFile f,
                                 java.lang.String fn,
                                 long ts,
                                 int tb,
                                 int bs,
                                 int minutes)

BabylonClientFileTransfer

public BabylonClientFileTransfer(BabylonPanel p,
                                 BabylonUser fu,
                                 java.lang.String fn,
                                 long ts,
                                 int tb,
                                 int bs,
                                 int minutes)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class BabylonFileTransfer

notifyAccepted

protected void notifyAccepted(BabylonUser user,
                              boolean acc)

cancel

protected void cancel()

Babylon Java Chat