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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 interface UHReceiver
      Parameters:
      fileName - the desired filename of the upload, usually as specified by the client
      MIMEType - the MIME type of the uploaded file
      Returns:
      stream to which the uploaded file should be written
    • getFileData

      public UHFileData 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