Class ClipboardFile

java.lang.Object
com.vaadin.flow.component.clipboard.ClipboardFile
All Implemented Interfaces:
Serializable

public final class ClipboardFile extends Object implements Serializable
A file or image delivered by the browser as part of a paste event.

The byte array returned by getData() is the file's content as uploaded from the browser; it is owned by this object and not defensively copied. Treat it as read-only.

See Also:
  • Method Details

    • getName

      public String getName()
      Returns the original file name reported by the browser. Pasted images typically arrive as image.png.
      Returns:
      the file name
    • getMimeType

      public String getMimeType()
      Returns the MIME type reported by the browser, e.g. image/png.
      Returns:
      the MIME type
    • getSize

      public long getSize()
      Returns the file size in bytes.
      Returns:
      the file size
    • getData

      public byte[] getData()
      Returns the raw file bytes. Owned by this object — do not modify.
      Returns:
      the file content