Interface Part.Factory

Enclosing interface:
Part<A>

public static interface Part.Factory

A factory for creating Part.

Since:
1.6
Author:
Jeremy Kuhn
  • Method Details

    • raw

      Part<ByteBuf> raw(Consumer<Part<ByteBuf>> partConfigurer)

      Creates a part with raw data.

      Parameters:
      partConfigurer - a part configurer
      Returns:
      a new part
    • string

      <T extends CharSequence> Part<T> string(Consumer<Part<T>> partConfigurer)

      Creates a part with string data.

      Type Parameters:
      T - the type of char sequence
      Parameters:
      partConfigurer - a part configurer
      Returns:
      a new part
    • resource

      Part<Resource> resource(Consumer<Part<Resource>> partConfigurer)

      Creates a part with a resource as data.

      The name of the resource shall be used as file name if no explicit file name is specified on the part. In a same way, content-type and content-length headers shall also be automatically set in the part if not explicitly specified.

      Parameters:
      partConfigurer - a pat configurer
      Returns:
      a new part