EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.tucana
Class UploadProgress

java.lang.Object
  extended by echopoint.tucana.UploadProgress
All Implemented Interfaces:
Serializable

public class UploadProgress
extends Object
implements Serializable

Contains information about the progress of a file upload. This class is thread-safe.

Note: Development of this component was sponsored by TCN Broadcasting. We are grateful for their support and sponsorship.

Version:
$Id: UploadProgress.java 106 2009-02-03 16:00:33Z sptrakesh $
Author:
Echo File Transfer Library
See Also:
Serialized Form

Constructor Summary
UploadProgress(long contentLength)
           
 
Method Summary
 long getBytesRead()
          Returns the number of bytes that have been read so far.
 long getContentLength()
          Returns the total number of bytes.
 int getEstimatedTimeLeft()
          Returns the estimated time left to complete the upload.
 String getMessage()
          Accessor for property 'message'.
 float getPercentCompleted()
          Returns the completion percentage.
 Status getStatus()
          Return the status of the current file upload process.
 long getTransferRate()
          Returns the throughput rate in bytes per second.
 void setBytesRead(long bytesRead)
          Sets the number of bytes that have been read so far.
 void setMessage(String message)
          Mutator for property 'message'.
 void setStatus(Status status)
          Set the status of the current file upload process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadProgress

public UploadProgress(long contentLength)
Parameters:
contentLength - the total number of bytes, -1 if unknown
Method Detail

getBytesRead

public long getBytesRead()
Returns the number of bytes that have been read so far.

Returns:
the number of bytes read.

getContentLength

public long getContentLength()
Returns the total number of bytes.

Returns:
the total number of bytes, -1 if unknown.

getPercentCompleted

public float getPercentCompleted()
Returns the completion percentage.

Returns:
the percentage as a float between 0 and 100, returns -1 if the total number of bytes to be read is unknown.

getTransferRate

public long getTransferRate()
Returns the throughput rate in bytes per second.

Returns:
the throughput rate as a long, returns -1 if the transfer rate is unknown yet.

getEstimatedTimeLeft

public int getEstimatedTimeLeft()
Returns the estimated time left to complete the upload.

Returns:
the estimated time in seconds, returns -1 if the estimated time is unknown.

setBytesRead

public void setBytesRead(long bytesRead)
Sets the number of bytes that have been read so far.

Parameters:
bytesRead - the number of bytes read

getStatus

public Status getStatus()
Return the status of the current file upload process.

Returns:
The status value.

setStatus

public void setStatus(Status status)
Set the status of the current file upload process.

Parameters:
status - The status value to set.

getMessage

public String getMessage()
Accessor for property 'message'.

Returns:
Value for property 'message'.

setMessage

public void setMessage(String message)
Mutator for property 'message'.

Parameters:
message - Value to set for property 'message'.

EchoPoint API - 3.0.0b5
App Webcontainer