Package com.vaadin.flow.server.streams
Class InMemoryUploadHandler
java.lang.Object
com.vaadin.flow.server.streams.TransferProgressAwareHandler<UploadEvent,InMemoryUploadHandler>
com.vaadin.flow.server.streams.InMemoryUploadHandler
- All Implemented Interfaces:
ElementRequestHandler
,UploadHandler
,Serializable
public class InMemoryUploadHandler
extends TransferProgressAwareHandler<UploadEvent,InMemoryUploadHandler>
implements UploadHandler
Upload handler for storing the upload in-memory. Data is returned as a
byte[]
to the given successHandler.- Since:
- 24.8
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TransferContext
getTransferContext
(UploadEvent transferEvent) This method is used to get the transfer context from the transfer events (e.g.void
handleUploadRequest
(UploadEvent event) Method that is called when the client wants to upload data to the url stored for this specific handler registration.Methods inherited from class com.vaadin.flow.server.streams.TransferProgressAwareHandler
addTransferProgressListener, getListeners, notifyError, onProgress, onProgress, onProgress, onProgress, whenComplete, whenComplete, whenStart, whenStart
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.server.streams.ElementRequestHandler
getDisabledUpdateMode, getUrlPostfix, isAllowInert
Methods inherited from interface com.vaadin.flow.server.streams.UploadHandler
getFileCountMax, getFileSizeMax, getRequestSizeMax, handleRequest, responseHandled
-
Constructor Details
-
InMemoryUploadHandler
-
-
Method Details
-
handleUploadRequest
Description copied from interface:UploadHandler
Method that is called when the client wants to upload data to the url stored for this specific handler registration.After upload of all files is done the method
UploadHandler.responseHandled(boolean, VaadinResponse)
will be called.- Specified by:
handleUploadRequest
in interfaceUploadHandler
- Parameters:
event
- upload event containing the necessary data for getting the request- Throws:
IOException
- if an error occurs during upload
-
getTransferContext
Description copied from class:TransferProgressAwareHandler
This method is used to get the transfer context from the transfer events (e.g.DownloadEvent
).- Specified by:
getTransferContext
in classTransferProgressAwareHandler<UploadEvent,
InMemoryUploadHandler> - Parameters:
transferEvent
- the transfer event- Returns:
- the transfer context
-