Package org.eclipse.rap.fileupload
Class FileUploadHandler
java.lang.Object
org.eclipse.rap.fileupload.FileUploadHandler
A file upload handler is used to accept file uploads from a client. After creating a file upload
 handler, the server will accept file uploads to the URL returned by 
getUploadUrl().
 Upload listeners can be attached to react on progress. When the upload has finished, a
 FileUploadHandler has to be disposed of by calling its dispose() method.- 
Constructor SummaryConstructorsConstructorDescriptionFileUploadHandler(FileUploadReceiver receiver) Constructs a file upload handler that is associated with the given receiver.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddUploadListener(FileUploadListener listener) Adds a the given file upload listener to the collection of listeners who will be notified when a file upload proceeds.voiddispose()Closes and de-registers the upload handler.longReturns the maximum file size in bytes allowed to be uploaded for this handler.Returns the file upload receiver that is associated with this file upload handler.longReturns the maximum upload duration.Returns the upload URL to which a file can be uploaded.voidremoveUploadListener(FileUploadListener listener) Removes the given file upload listener from the collection of listeners who will be notified when a file upload proceeds.voidsetMaxFileSize(long maxFileSize) Sets the maximum file size in bytes allowed to be uploaded for this handler.voidsetUploadTimeLimit(long timeLimit) Sets the maximum upload duration in milliseconds.
- 
Constructor Details- 
FileUploadHandlerConstructs a file upload handler that is associated with the given receiver. The receiver is responsible for reading and processing the uploaded data.- Parameters:
- receiver- the receiver that should process the uploaded data, must not be- null
 
 
- 
- 
Method Details- 
getUploadUrlReturns the upload URL to which a file can be uploaded.- Returns:
- the encoded upload URL
 
- 
getReceiverReturns the file upload receiver that is associated with this file upload handler.- Returns:
- the associated receiver
 
- 
addUploadListenerAdds a the given file upload listener to the collection of listeners who will be notified when a file upload proceeds.- Parameters:
- listener- the file upload listener to add, must not be- null
- See Also:
 
- 
removeUploadListenerRemoves the given file upload listener from the collection of listeners who will be notified when a file upload proceeds.- Parameters:
- listener- the file upload listener to remove, must not be- null
- See Also:
 
- 
disposepublic void dispose()Closes and de-registers the upload handler. After calling this method, no subsequent upload requests for this handler will be accepted anymore. Clients must call this method before discarding the instance of the handler to allow it to be garbage collected.
- 
getMaxFileSizepublic long getMaxFileSize()Returns the maximum file size in bytes allowed to be uploaded for this handler. The default value of -1, indicates no limit.- See Also:
 
- 
setMaxFileSizepublic void setMaxFileSize(long maxFileSize) Sets the maximum file size in bytes allowed to be uploaded for this handler. A value of -1 indicates no limit.- See Also:
 
- 
getUploadTimeLimitpublic long getUploadTimeLimit()Returns the maximum upload duration. If upload takes longer than this it will be interrupted. The default value of -1, indicates no limit.- Since:
- 3.3
 
- 
setUploadTimeLimitpublic void setUploadTimeLimit(long timeLimit) Sets the maximum upload duration in milliseconds. If upload takes longer than this it will be interrupted. The default value of -1, indicates no limit.- Since:
- 3.3
- See Also:
 
 
-