|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.clients.web.fileupload.FileUploadProgress
public class FileUploadProgress
Objects of this class holds information about the progress
of an upload. Use the FileUpload.getProgress()
to get
the progress that is associated with a particular file upload.
Use the getTotalBytes()
and
getTransferredBytes()
to get information
about how the upload is progressing.
FileUpload
Field Summary | |
---|---|
private boolean |
abort
|
private String |
currentFilename
|
private Throwable |
exception
|
private long |
startTime
|
private long |
totalBytes
|
private long |
transferredBytes
|
Constructor Summary | |
---|---|
FileUploadProgress(long totalBytes)
Create a new FileUploadProgress object. |
Method Summary | |
---|---|
(package private) void |
addTransferredBytes(long bytes)
Adds a value to the number of transfered bytes. |
String |
getCurrentFilename()
Get the name of the file that is currently beeing transferred. |
Throwable |
getException()
Get the exception that caused the upload to fail. |
long |
getMillisecondsSinceStart()
Get the number of milliseconds since the start of the upload. |
long |
getTotalBytes()
Get the total number of bytes expected to upload. |
long |
getTransferredBytes()
Get the number of bytes that have been uploaded so far. |
boolean |
hasAborted()
Check if the upload has been requested to be aborted. |
void |
setAbort()
Request that the upload should be aborted. |
(package private) void |
setCurrentFilename(String filename)
Sets the name of the file that is currently uploading |
(package private) void |
setException(Throwable exception)
Set the exception that caused the upload to fail. |
(package private) void |
setTransferredBytes(long bytes)
Sets the number of transferred bytes. |
boolean |
transferIsComplete()
Checks if the transfer is complete or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final long totalBytes
private final long startTime
private long transferredBytes
private String currentFilename
private Throwable exception
private boolean abort
Constructor Detail |
---|
FileUploadProgress(long totalBytes)
FileUploadProgress
object.
This constructor is package private. Use FileUpload.getProgress()
to get the progress that is
associated with a particular file upload.
totalBytes
- The total number of bytes that should be uploaded.Method Detail |
---|
public long getTotalBytes()
public long getTransferredBytes()
void setTransferredBytes(long bytes)
bytes
- The number of bytesvoid addTransferredBytes(long bytes)
bytes
- The value to add to the number of transfered bytespublic boolean transferIsComplete()
public String getCurrentFilename()
void setCurrentFilename(String filename)
filename
- The name of the filepublic Throwable getException()
Throwable
or null if no exception has occuredvoid setException(Throwable exception)
public long getMillisecondsSinceStart()
public void setAbort()
FileUpload
object will check this property at regular intervals and if set
it will close the upload stream as soon as possible, and then throw an
UploadAbortedException
which will also be available from the
getException()
method.
public boolean hasAborted()
getException()
method to actually check if the upload
has been aborted.
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |