wjhk.jupload2.upload
Interface FileUploadThread

All Known Implementing Classes:
DefaultFileUploadThread, FileUploadThreadFTP, FileUploadThreadHTTP

public interface FileUploadThread

This interface defines the methods of the various FileUploadThread classes. These classes are kept in the CVS, as people often update them for their needs: I don't want to remove them, when I do a 'big bang' within them. Created on 21 nov. 06


Method Summary
 void close()
          Closes the connection to the server and releases resources.
 Exception getException()
          Get the exception that occurs during upload.
 String getResponseMsg()
          Get the server response message.
 long getStartTime()
           
 long getTotalLength()
           
 long getUploadedLength()
           
 boolean isAlive()
           
 boolean isUploadStopped()
          Returns true if someone asks the thread to stop.
 void join()
           
 void join(long millisec)
           
 void nbBytesUploaded(long nbBytes)
          Indicate to the UploadThread that nbBytes bytes have been uploaded to the server.
 void start()
           
 void stopUpload()
          Stopping the Thread
 

Method Detail

stopUpload

void stopUpload()
Stopping the Thread


isUploadStopped

boolean isUploadStopped()
Returns true if someone asks the thread to stop.

Returns:
true if the upload has been requested to stop.
See Also:
stopUpload()

getResponseMsg

String getResponseMsg()
Get the server response message. In HTTP mode, it's the body part, without the HTTP headers.
Note: was getResponseMsg until release 3.4.1.

Returns:
The String that contains the HTTP response message (e.g. "SUCCESS")

getException

Exception getException()
Get the exception that occurs during upload.

Returns:
The exception, or null if no exception were thrown.

nbBytesUploaded

void nbBytesUploaded(long nbBytes)
Indicate to the UploadThread that nbBytes bytes have been uploaded to the server. It's up to this method to change the display on the progress bar (or whatever other information displayed to the user)

Parameters:
nbBytes - Number of bytes uploaded.

getUploadedLength

long getUploadedLength()
Returns:
The current number of bytes, already uploaded in this thread.

getTotalLength

long getTotalLength()
Returns:
The total number of bytes, to be uploaded in this thread.

close

void close()
Closes the connection to the server and releases resources.


getStartTime

long getStartTime()
Returns:
The start time stamp of this instance.

isAlive

boolean isAlive()
Returns:
true if the thread is currently working.
See Also:
Thread.isAlive()

join

void join()
          throws InterruptedException
Throws:
InterruptedException
See Also:
Thread.join()

join

void join(long millisec)
          throws InterruptedException
Parameters:
millisec -
Throws:
InterruptedException
See Also:
Thread.join(long)

start

void start()
See Also:
Thread.start()