Drag_n_Drop
Class Receive
java.lang.Object
Drag_n_Drop.Receive
- All Implemented Interfaces:
- java.lang.Runnable
public class Receive
- extends java.lang.Object
- implements java.lang.Runnable
Run as a thread to receive file and handle exceptions during transfer.
Create instance of ReceiveBar to show sending progress.
- See Also:
ReceiveBar
Method Summary |
static java.lang.String |
bytesToDisplay(int bytesLength)
Change the bytes number to readable file length. |
void |
run()
Run method receives the file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
saveDirectory
public static java.lang.String saveDirectory
displayFileName
public static java.lang.String displayFileName
sender_host
public static java.lang.String sender_host
length_received
public static int length_received
file_length
public static int file_length
receive_finish
public static boolean receive_finish
server
public static java.net.ServerSocket server
receive_stop
public static boolean receive_stop
Receive
public Receive()
bytesToDisplay
public static java.lang.String bytesToDisplay(int bytesLength)
- Change the bytes number to readable file length.
- Parameters:
bytesLength
- byte number of the file
- Returns:
- readable file length
run
public void run()
- Run method receives the file.
Create intance of ReceiveBar to show progressbar during transfer.
- Specified by:
run
in interface java.lang.Runnable
- See Also:
ReceiveBar