Class MemoryBuffer
java.lang.Object
com.vaadin.flow.component.upload.receivers.MemoryBuffer
- All Implemented Interfaces:
Receiver
,Serializable
Basic in memory file receiver implementation.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the file data object.Get the file name for this buffer.Get the input stream for file with filename.receiveUpload
(String fileName, String MIMEType) Invoked when a new upload arrives.
-
Constructor Details
-
MemoryBuffer
public MemoryBuffer()
-
-
Method Details
-
receiveUpload
Description copied from interface:Receiver
Invoked when a new upload arrives.- Specified by:
receiveUpload
in interfaceReceiver
- Parameters:
fileName
- the desired filename of the upload, usually as specified by the clientMIMEType
- the MIME type of the uploaded file- Returns:
- stream to which the uploaded file should be written
-
getFileData
Get the file data object.- Returns:
- file data for the latest upload or null
-
getFileName
Get the file name for this buffer.- Returns:
- file name or empty if no file
-
getInputStream
Get the input stream for file with filename.- Returns:
- input stream for file or empty stream if file not found
-