Class ContentDisposition.Builder

java.lang.Object
org.apache.juneau.http.header.ContentDisposition.Builder
Enclosing class:
ContentDisposition

public static class ContentDisposition.Builder extends Object
Fluent builder for assembling an HTTP Content-Disposition header value.

Composes the disposition-type and parameters defined by RFC 6266 into the disposition-type; param=value; ... wire format. Typed setters cover the common parameters and apply the correct rendering (quoted-string for textual params, a bare number for size, and a raw RFC 5987 ext-value for filename*); param(String, String) is a generic escape hatch. Setters overwrite a previously-set parameter of the same name while preserving its original position.

Example:

String value = ContentDisposition.create() .attachment() .filename("genome.jpeg") .size(12345) .build(); // => "attachment; filename=\"genome.jpeg\"; size=12345"

See Also:
Since:
10.0.0
  • Constructor Details

  • Method Details