Interface UploadFileHandler.CallbackFileHandler

Enclosing class:
UploadFileHandler
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface UploadFileHandler.CallbackFileHandler
An interface accepting file uploads.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.server.Command
    This method is called by the framework when a new file is being received.
  • Method Details

    • handleFile

      com.vaadin.flow.server.Command handleFile(InputStream content, UploadFileHandler.FileDetails metaData) throws IOException
      This method is called by the framework when a new file is being received.

      You can read the file contents from the given InputStream.

      Note, that this method is not executed in the UI thread. If you want to modify the UI from it, by sure to use UI.access (and possibly Push annotation) to handle locking properly.

      Parameters:
      content - the file content
      metaData - details about the file being updated
      Returns:
      a task to be executed later in UI thread once the file upload is completed
      Throws:
      IOException - like you always do with streams