com.vaadin.flow.component.upload.receivers.

Class MultiFileBuffer

java.lang.Object
com.vaadin.flow.component.upload.receivers.AbstractFileBuffer
com.vaadin.flow.component.upload.receivers.MultiFileBuffer

All Implemented Interfaces:

MultiFileReceiver, Receiver, Serializable

@Deprecated(since="24.8", forRemoval=true) public class MultiFileBuffer extends AbstractFileBuffer implements MultiFileReceiver
Deprecated, for removal: This API element is subject to removal in a future version.
Use UploadHandler instead

Basic receiver implementation for receiving multiple file upload and storing them as files. Files are stored by default to Files 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
    Description

    Deprecated, for removal: This API element is subject to removal in a future version.

    Creates a file buffer with a default file factory.

    Deprecated, for removal: This API element is subject to removal in a future version.

    Creates a file buffer that uses a file factory to create custom upload Files.

  • Method Summary

    Modifier and Type
    Method
    Description
    getFileData(String fileName)

    Deprecated, for removal: This API element is subject to removal in a future version.

    Get file data for upload with file name.

    Deprecated, for removal: This API element is subject to removal in a future version.

    Get the output stream for file.

    Deprecated, for removal: This API element is subject to removal in a future version.

    Get the files stored for this buffer.

    Deprecated, for removal: This API element is subject to removal in a future version.

    Get the input stream for file with fileName.

    receiveUpload(String fileName, String mimeType)

    Deprecated, for removal: This API element is subject to removal in a future version.

    Invoked when a new upload arrives.

    Methods inherited from class com.vaadin.flow.component.upload.receivers.AbstractFileBuffer

    createFileOutputStream, getLogger

    Methods inherited from class java.lang.Object

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

    • MultiFileBuffer

      public MultiFileBuffer()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Creates a file buffer with a default file factory.

      Files will be created using File.createTempFile(String, String) and have that build 'upload_tmpfile_{FILENAME}_{currentTimeMillis}'

    • MultiFileBuffer

      public MultiFileBuffer(FileFactory factory)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Creates a file buffer that uses a file factory to create custom upload Files.

      Parameters:

      factory - file factory for file buffer

  • Method Details

    • receiveUpload

      public OutputStream receiveUpload(String fileName, String mimeType)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Description copied from interface: Receiver

      Invoked when a new upload arrives.

      Specified by:

      receiveUpload in interface Receiver

      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 Set<String> getFiles()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Get the files stored for this buffer.

      Returns:

      files stored

    • getFileData

      public FileData getFileData(String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.

      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

    • getFileDescriptor

      public FileDescriptor getFileDescriptor(String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.

      Get the output stream for file.

      Parameters:

      fileName - name of file to get stream for

      Returns:

      file output stream or null if not available

    • getInputStream

      public InputStream getInputStream(String fileName)
      Deprecated, for removal: This API element is subject to removal in a future version.

      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