com.vaadin.flow.component.upload.receivers.
Class FileBuffer
- java.lang.Object
-
- com.vaadin.flow.component.upload.receivers.AbstractFileBuffer
-
- com.vaadin.flow.component.upload.receivers.FileBuffer
-
All Implemented Interfaces:
public class FileBuffer extends AbstractFileBuffer implements Receiver
Basic in file receiver implementation. File is stored by default to File 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 FileBuffer()
-
Method Summary
All Methods Modifier and Type Method and Description FileData
getFileData()
Get the file data object.
FileDescriptor
getFileDescriptor()
Get the output stream for file.
String
getFileName()
Get the file name for this buffer.
InputStream
getInputStream()
Get the input stream for file.
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()
Get the file data object.
Returns:
file data for the latest upload or null
-
getFileName
public String getFileName()
Get the file name for this buffer.
Returns:
file name or empty if no file
-
getFileDescriptor
public FileDescriptor getFileDescriptor()
Get the output stream for file.
Returns:
file output stream or null if not available
-
getInputStream
public InputStream getInputStream()
Get the input stream for file.
Returns:
input stream for file or empty stream if file not found
-
-