Class FileReader
java.lang.Object
com.levigo.jadice.web.demo.common.client.commands.FileReader
A utility class providing different utility methods for reading files via JavaScript.
There are currently two utility methods provided by this class.
- The method getFileCount returns the number of files contained by the given JavaScript object
- The method readFile reads the given fill and returns a FileReadrResult containing the file name, the red data, the content type and the size of the file.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns the number of files contained by the given javascript objectstatic void
readFile
(Object e, int i, AsyncCallback<FileReader.FileReadResult> callback) Reads the specified file and returns the result via theAsyncCallback
as aFileReader.FileReadResult
.
-
Constructor Details
-
FileReader
public FileReader()
-
-
Method Details
-
getFileCount
Returns the number of files contained by the given javascript object- Parameters:
e
- the javascript object containing the file- Returns:
- the file count
-
readFile
Reads the specified file and returns the result via theAsyncCallback
as aFileReader.FileReadResult
.- Parameters:
e
- the javascript element containing the filesi
- the index of the files inside the list of files contained by the javascript filecallback
- theAsyncCallback
to wich the result should be returned
-