Drag_n_Drop
Class Receive

java.lang.Object
  extended by 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

Field Summary
static java.lang.String displayFileName
           
static int file_length
           
static int length_received
           
static boolean receive_finish
           
static boolean receive_stop
           
static java.lang.String saveDirectory
           
static java.lang.String sender_host
           
static java.net.ServerSocket server
           
 
Constructor Summary
Receive()
           
 
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
 

Field Detail

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
Constructor Detail

Receive

public Receive()
Method Detail

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