com.vaadin.flow.component.upload.receivers.
Class MultiFileBuffer
- java.lang.Object
-
- com.vaadin.flow.component.upload.receivers.AbstractFileBuffer
-
- com.vaadin.flow.component.upload.receivers.MultiFileBuffer
-
All Implemented Interfaces:
public class MultiFileBuffer extends AbstractFileBuffer implements MultiFileReceiver
Basic receiver implementation for receiving multiple file upload and storing them as files. Files are stored by default to Files created using
File.createTempFile(String, String)
with a null suffix.For a custom file the constructor
AbstractFileBuffer(FileFactory)
should be used.See Also:
-
-
Constructor Summary
Constructors Constructor and Description MultiFileBuffer()
-
Method Summary
All Methods Modifier and Type Method and Description FileData
getFileData(String fileName)
Get file data for upload with file name.
FileDescriptor
getFileDescriptor(String fileName)
Get the output stream for file.
Set<String>
getFiles()
Get the files stored for this buffer.
InputStream
getInputStream(String fileName)
Get the input stream for file with fileName.
OutputStream
receiveUpload(String fileName, String MIMEType)
Invoked when a new upload arrives.
-
Methods inherited from class com.vaadin.flow.component.upload.receivers.AbstractFileBuffer
createFileOutputStream, getLogger
-
-
-
-
Method Detail
-
receiveUpload
public OutputStream receiveUpload(String fileName, String MIMEType)
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 fileReturns:
stream to which the uploaded file should be written
-
getFileData
public FileData getFileData(String fileName)
Get file data for upload with file name.
Parameters:
fileName
- file name to get upload data forReturns:
file data for filename or null if not found
-
getFileDescriptor
public FileDescriptor getFileDescriptor(String fileName)
Get the output stream for file.
Parameters:
fileName
- name of file to get stream forReturns:
file output stream or null if not available
-
getInputStream
public InputStream getInputStream(String fileName)
Get the input stream for file with fileName.
Parameters:
fileName
- name of file to get input stream forReturns:
input stream for file or empty stream if file not found
-
-