Package eu.webtoolkit.jwt
Class WFileDropWidget.File
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WFileDropWidget.File
- Direct Known Subclasses:
WFileDropWidget.Directory
- Enclosing class:
- WFileDropWidget
A nested class of
WFileDropWidget
representing a file.
The methods returning the filename, mime-type and size return valid values if the upload of
this file is not yet finished. The method getUploadedFile()
is only available after the upload is finished.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis signal allows you to track the upload progress of the file.void
emitDataReceived
(long current, long total, boolean filterSupported) Returns the client filename.Returns the mime-type of the file.getPath()
Returns the path of the file.long
getSize()
Returns the size of the file.Returns the uploaded file as aUploadedFile
.void
handleIncomingData
(UploadedFile file, boolean last) boolean
boolean
Returns whether this is a directory.boolean
boolean
boolean
Returns true if the upload is finished.void
setFilterEnabled
(boolean enabled) void
setIsFiltered
(boolean filtered) uploaded()
This signal is triggered when the upload is finished.Methods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, setFormData, setObjectName, tr
-
Constructor Details
-
File
-
-
Method Details
-
getClientFileName
Returns the client filename. -
getPath
Returns the path of the file.This is only relevant if the user dropped a folder. The path will be relative to the folder that was dropped.
-
isDirectory
public boolean isDirectory()Returns whether this is a directory. -
getMimeType
Returns the mime-type of the file. -
getSize
public long getSize()Returns the size of the file. -
getUploadedFile
Returns the uploaded file as aUploadedFile
.This method will throw an expection if the upload is not yet finished.
- See Also:
-
isUploadFinished
public boolean isUploadFinished()Returns true if the upload is finished.When this method returns true, the uploaded file is available on the server.
- See Also:
-
dataReceived
This signal allows you to track the upload progress of the file.The first argument is the number of bytes received so far, and the second argument is the total number of bytes.
-
uploaded
This signal is triggered when the upload is finished.This is also signalled using the
WFileDropWidget
WFileDropWidget.uploaded()
signal. -
setFilterEnabled
public void setFilterEnabled(boolean enabled) -
isFilterEnabled
public boolean isFilterEnabled() -
isFiltered
public boolean isFiltered() -
handleIncomingData
-
isCancelled
public boolean isCancelled() -
emitDataReceived
public void emitDataReceived(long current, long total, boolean filterSupported) -
setIsFiltered
public void setIsFiltered(boolean filtered)
-