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
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.server.Command
    handleFile(InputStream content, String fileName, String mimeType)
    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, String fileName, String mimeType)
      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
      fileName - the name of the file in users device
      mimeType - the mime type parsed from the file name
      Returns:
      a task to be executed later in UI thread once the file upload is completed