|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--FileTransfer.v1_1.FTClientWindow.TransferThread
TransferThread extends Thread. It is in charge of transfering a file
from this FTClient to another one. If first ask wether the other user
accepts the file this user wants to send him. If he accepts, the file is
read and parts of the file are sent one at a time to the other user in
the form of byte arrays. The size of the byte array is defined by the
bytesize property. These operations are performed in a separate thread
so that the EventDispatchThread that is in charge of handling GUI events
is releaved and can continue.
It is also in charge of resuming a filetransfer. This is specified in
the constructor. It uses the bytesTransferred property to know how where
to restart the filetransfer.
Field Summary | |
private int |
bytesTransferred
|
private boolean |
finished
Specifies wether the thread should continue or stop. |
private boolean |
shallResume
|
private FTClientWindow |
window
Reference to the FTClientWindow. |
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
FTClientWindow.TransferThread(FTClientWindow window,
boolean shallResume)
Creates a new TransferThread. |
Method Summary | |
private void |
resumeTransfer()
Resumes a suspended filetransfer. |
void |
run()
Checks which one of the XXXTransfer methods to call and calls it. |
void |
setBytesTransferred(int b)
Sets how much of a file that has been transferred. |
void |
setFinished(boolean b)
Called when the user wants the filetransfer to stop before it is finished. |
private void |
startTransfer()
Starts a new filetransfer. |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private boolean finished
private FTClientWindow window
private boolean shallResume
private int bytesTransferred
Constructor Detail |
public FTClientWindow.TransferThread(FTClientWindow window, boolean shallResume)
window
- Reference to the FTClientWindow.shallResume
- Specifies wether a new filetransfer shall be
started or a suspended on shall be resumed.Method Detail |
public void run()
run
in class java.lang.Thread
public void setBytesTransferred(int b)
b
- The amount.public void setFinished(boolean b)
private void resumeTransfer()
private void startTransfer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |