Class File.Builder

java.lang.Object
com.teamdev.jxbrowser.net.File.Builder
Enclosing interface:
File

public static final class File.Builder extends Object
A builder of File.

Builders are created by invoking File.newBuilder(). Each of the setter methods modifies the state of the builder and returns the same instance. Builders are not thread-safe and should not be used concurrently from multiple threads without external synchronization.

  • Method Details

    • name

      public File.Builder name(String name)
    • contentType

      public File.Builder contentType(String contentType)
      Sets the file content type determined by the file extension.
      Parameters:
      contentType - the file content type determined by the file extension
      Returns:
      this builder
    • pathValue

      public File.Builder pathValue(Path path)
      Sets the file path.
      Parameters:
      path - the file path
      Returns:
      this builder
    • bytesValue

      public File.Builder bytesValue(byte[] bytes)
      Sets the byte sequence representing the file upload data segment.
      Parameters:
      bytes - the byte sequence representing the file upload data segment
      Returns:
      this builder
    • build

      public File build()
      Returns a new File instance built from the current state of this builder.
      Returns:
      a new File instance