Class UHMultiFileMemoryBuffer

java.lang.Object
org.vaadin.addons.f0rce.uploadhelper.receiver.UHMultiFileMemoryBuffer
All Implemented Interfaces:
java.io.Serializable, UHMultiFileReceiver, UHReceiver

public class UHMultiFileMemoryBuffer
extends java.lang.Object
implements UHMultiFileReceiver
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    UHMultiFileMemoryBuffer()  
  • Method Summary

    Modifier and Type Method Description
    UHFileData getFileData​(java.lang.String fileName)
    Get file data for upload with file name.
    java.util.Set<java.lang.String> getFiles()
    Get the files in memory for this buffer.
    java.io.InputStream getInputStream​(java.lang.String filename)
    Get the input stream for file with filename.
    java.io.ByteArrayOutputStream getOutputBuffer​(java.lang.String fileName)
    Get the output stream for file.
    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
    • getFiles

      public java.util.Set<java.lang.String> getFiles()
      Get the files in memory for this buffer.
      Returns:
      files in memory
    • getFileData

      public UHFileData getFileData​(java.lang.String fileName)
      Get file data for upload with file name.
      Parameters:
      fileName - file name to get upload data for
      Returns:
      file data for filename or null if not found
    • getOutputBuffer

      public java.io.ByteArrayOutputStream getOutputBuffer​(java.lang.String fileName)
      Get the output stream for file.
      Parameters:
      fileName - name of file to get stream for
      Returns:
      file output stream or empty stream if no file found
    • getInputStream

      public java.io.InputStream getInputStream​(java.lang.String filename)
      Get the input stream for file with filename.
      Parameters:
      filename - name of file to get input stream for
      Returns:
      input stream for file or empty stream if file not found