public final class File
extends com.google.gwt.core.client.JavaScriptObject
UploadProgressHandler.
Note that, by default, the SWFUpload "Speed" plugin is enabled, providing access to additional
metrics on this object such as getAverageSpeed(), getPercentUploaded(), etc.
| Modifier and Type | Class and Description |
|---|---|
static class |
File.Status
An enumeration of reported file status types, which can be determined during
any of the uploader events, such as
UploadEvent.getFile(). |
| Modifier | Constructor and Description |
|---|---|
protected |
File()
Instances of the File object can not be created directly, but should instead
be obtained via an event handler.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getAverageSpeed()
Return a floating point number indicating the overall average uploader speed,
bytes per second, in bits per second.
|
protected java.util.Date |
getCreationDate()
Returns the date the file was created, as reported by the client machine.
|
double |
getCurrentSpeed()
Return a floating point number indicating the current uploader speed of
the file, in bits per second.
|
java.lang.String |
getId()
Return the unique id of the file instance as it is being maintained within the Uploader
component file queue.
|
int |
getIndex()
Return the index of the file within the queue of files being uploaded by the
Uploader component.
|
java.util.Date |
getModificationDate()
Return the date the file was last modified, as reported by the client machine, or null
if the browser or OS did not make the file's modification date available.
|
double |
getMovingAverageSpeed()
Return a floating point number indicating the uploader speed averaged over the
last several measurements, in bits per second.
|
java.lang.String |
getName()
Return the original name of the file being uploaded.
|
double |
getPercentUploaded()
Return a floating point number indicating the percentage of the
file uploaded (0 to 100).
|
long |
getSize()
Return the original size of the file being uploaded (in bytes).
|
double |
getSizeUploaded()
Return a floating point number indicating the size uploaded so far, in bytes.
|
File.Status |
getStatus()
Get the file's current status (see
File.Status enumeration for possible values). |
double |
getTimeElapsed()
Return a floating point number indicating the number of seconds
passed so far for this uploader.
|
double |
getTimeRemaining()
Return a floating point number indicating the estimated remaining
uploader time, in seconds.
|
java.lang.String |
getType()
Return the mime type of the file being uploaded.
|
protected File()
UploadEvent.getFile().public java.lang.String getId()
public int getIndex()
public java.lang.String getName()
public long getSize()
public java.lang.String getType()
protected java.util.Date getCreationDate()
getModificationDate() method instead (which is available in both
cases).
Reference: http://www.w3.org/TR/file-uploader/#dfn-filepublic java.util.Date getModificationDate()
public File.Status getStatus()
File.Status enumeration for possible values).public double getCurrentSpeed()
public double getAverageSpeed()
public double getMovingAverageSpeed()
public double getTimeRemaining()
public double getTimeElapsed()
public double getPercentUploaded()
public double getSizeUploaded()