Interface UploadFileHandler.CallbackFileHandler
- Enclosing class:
- UploadFileHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.server.Command
handleFile
(InputStream content, String fileName, String mimeType) This method is called by the framework when a new file is being received.
-
Method Details
-
handleFile
This method is called by the framework when a new file is being received.You can read the file contents from the given InputStream.
Note, that this method is not executed in the UI thread. If you want to modify the UI from it, by sure to use UI.access (and possibly Push annotation) to handle locking properly.
- Parameters:
content
- the file contentfileName
- the name of the file in users devicemimeType
- the mime type parsed from the file name- Returns:
- a task to be executed later in UI thread once the file upload is completed
-