Class UHMemoryBuffer
java.lang.Object
org.vaadin.addons.f0rce.uploadhelper.receiver.UHMemoryBuffer
- All Implemented Interfaces:
java.io.Serializable
,UHReceiver
public class UHMemoryBuffer extends java.lang.Object implements UHReceiver
Basic in memory file receiver implementation.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description UHMemoryBuffer()
-
Method Summary
Modifier and Type Method Description UHFileData
getFileData()
Get the file data object.java.lang.String
getFileName()
Get the file name for this buffer.java.io.InputStream
getInputStream()
Get the input stream for file with filename.java.io.OutputStream
receiveUpload(java.lang.String fileName, java.lang.String MIMEType)
Invoked when a new upload arrives.
-
Constructor Details
-
UHMemoryBuffer
public UHMemoryBuffer()
-
-
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
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
-
getInputStream
public java.io.InputStream getInputStream()Get the input stream for file with filename.- Returns:
- input stream for file or empty stream if file not found
-