Class MultiFileMemoryBuffer
- java.lang.Object
-
- com.vaadin.flow.component.upload.receivers.MultiFileMemoryBuffer
-
- All Implemented Interfaces:
MultiFileReceiver,Receiver,Serializable
public class MultiFileMemoryBuffer extends Object implements MultiFileReceiver
Basic multi file in memory file receiver implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiFileMemoryBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileDatagetFileData(String fileName)Get file data for upload with file name.Set<String>getFiles()Get the files in memory for this buffer.InputStreamgetInputStream(String filename)Get the input stream for file with filename.ByteArrayOutputStreamgetOutputBuffer(String fileName)Get the output stream for file.OutputStreamreceiveUpload(String fileName, String MIMEType)Invoked when a new upload arrives.
-
-
-
Method Detail
-
receiveUpload
public OutputStream receiveUpload(String fileName, String MIMEType)
Description copied from interface:ReceiverInvoked when a new upload arrives.- Specified by:
receiveUploadin 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
-
getFiles
public Set<String> getFiles()
Get the files in memory for this buffer.- Returns:
- files in memory
-
getFileData
public FileData getFileData(String fileName)
Get file data for upload with file name.- Parameters:
fileName- file name to get upload data for- Returns:
- file data for filename or null if not found
-
getOutputBuffer
public ByteArrayOutputStream getOutputBuffer(String fileName)
Get the output stream for file.- Parameters:
fileName- name of file to get stream for- Returns:
- file output stream or empty stream if no file found
-
getInputStream
public InputStream getInputStream(String filename)
Get the input stream for file with filename.- Parameters:
filename- name of file to get input stream for- Returns:
- input stream for file or empty stream if file not found
-
-