Interface File


public interface File
File data.

Depending on how the File instance is created, it can correspond to one of the following:

  1. File path, if the file is selected from an <input type="file"> element in a submitted form.
  2. File bytes, if the request is created via the JavaScript API, and a file is passed as a part of the multipart/form-data body.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder of File.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Optional<byte[]>
    Returns the file value as an array of bytes.
    default String
    Returns the content type.
    default String
    Returns the file name.
    Creates a new File builder.
    default Optional<String>
    Returns the file value as a file path.
  • Method Details

    • newBuilder

      static File.Builder newBuilder()
      Creates a new File builder.
      Returns:
      a new File.Builder instance
    • name

      default String name()
      Returns the file name.
    • contentType

      default String contentType()
      Returns the content type.
    • pathValue

      default Optional<String> pathValue()
      Returns the file value as a file path.
    • bytesValue

      default Optional<byte[]> bytesValue()
      Returns the file value as an array of bytes.