Package org.eclipse.rap.fileupload
Class DiskFileUploadReceiver
java.lang.Object
org.eclipse.rap.fileupload.FileUploadReceiver
org.eclipse.rap.fileupload.DiskFileUploadReceiver
A file upload receiver that stores received files on disk.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected FilecreateContentTypeFile(File uploadedFile, FileDetails details) Creates a file to save the content-type.protected FilecreateTargetFile(FileDetails details) Creates a file to save the received data to.static StringgetContentType(File uploadedFile) Obtains the content type provided by the client when the given file was uploaded.File[]Returns an array with files that the received data has been saved to.Return the directory where the file should be uploaded to, ornullwhen a temporary directory is used.voidreceive(InputStream dataStream, FileDetails details) Reads and processes all data from the provided input stream.voidsetUploadDirectory(File directory) Set the directory to upload to.
- 
Constructor Details- 
DiskFileUploadReceiverpublic DiskFileUploadReceiver()
 
- 
- 
Method Details- 
receiveDescription copied from class:FileUploadReceiverReads and processes all data from the provided input stream.- Specified by:
- receivein class- FileUploadReceiver
- Parameters:
- dataStream- the stream to read from
- details- the details of the uploaded file like file name, content-type and size
- Throws:
- IOException- if an input / output error occurs
 
- 
getContentTypeObtains the content type provided by the client when the given file was uploaded. This method does not look at the uploaded file contents to determine the content type.- Parameters:
- uploadedFile- - the file that was uploaded and handled by an instance of DiskFileUploadReceiver.
- Returns:
- the content type of the uploaded file or nullif the content type could not be found.
 
- 
getTargetFilesReturns an array with files that the received data has been saved to.- Returns:
- the array with target files or empty array if no files have been stored yet
 
- 
setUploadDirectorySet the directory to upload to. If none is set, the default directory will be used- Parameters:
- directory- the directory to use
- Since:
- 3.7
 
- 
getUploadDirectoryReturn the directory where the file should be uploaded to, ornullwhen a temporary directory is used.- Since:
- 3.7
 
- 
createTargetFileCreates a file to save the received data to. Subclasses may override.- Parameters:
- details- the details of the uploaded file like file name, content-type and size
- Returns:
- the file to store the data in
- Throws:
- IOException
 
- 
createContentTypeFileCreates a file to save the content-type. Subclasses may override.- Parameters:
- uploadedFile- the file that contains uploaded data
- details- the details of the uploaded file like file name, content-type and size
- Returns:
- the file to store the content-type data in
- Throws:
- IOException
 
 
-