Class UHFileBuffer
java.lang.Object
org.vaadin.addons.f0rce.uploadhelper.receiver.UHAbstractFileBuffer
org.vaadin.addons.f0rce.uploadhelper.receiver.UHFileBuffer
- All Implemented Interfaces:
java.io.Serializable
,UHReceiver
public class UHFileBuffer extends UHAbstractFileBuffer implements UHReceiver
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
UHAbstractFileBuffer(UHFileFactory)
should be
used.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description UHFileBuffer()
-
Method Summary
Modifier and Type Method Description com.vaadin.flow.component.upload.receivers.FileData
getFileData()
Get the file data object.java.io.FileDescriptor
getFileDescriptor()
Get the output stream for file.java.lang.String
getFileName()
Get the file name for this buffer.java.io.InputStream
getInputStream()
Get the input stream for file.java.io.OutputStream
receiveUpload(java.lang.String fileName, java.lang.String MIMEType)
Invoked when a new upload arrives.
-
Constructor Details
-
UHFileBuffer
public UHFileBuffer()
-
-
Method Details
-
receiveUpload
public java.io.OutputStream receiveUpload(java.lang.String fileName, java.lang.String MIMEType)Description copied from interface:UHReceiver
Invoked when a new upload arrives.- Specified by:
receiveUpload
in interfaceUHReceiver
- 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
public com.vaadin.flow.component.upload.receivers.FileData getFileData()Get the file data object.- Returns:
- file data for the latest upload or null
-
getFileName
public java.lang.String getFileName()Get the file name for this buffer.- Returns:
- file name or empty if no file
-
getFileDescriptor
public java.io.FileDescriptor getFileDescriptor()Get the output stream for file.- Returns:
- file output stream or null if not available
-
getInputStream
public java.io.InputStream getInputStream()Get the input stream for file.- Returns:
- input stream for file or empty stream if file not found
-