Package org.nuxeo.common.utils
Class RFC2231
java.lang.Object
org.nuxeo.common.utils.RFC2231
RFC-2231 specifies how a MIME parameter value, like
Content-Disposition's filename, can be encoded to
contain arbitrary character sets.- Author:
- Florent Guillaume
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodeContentDisposition(String filename, boolean inline) Encodes aContent-Dispositionheader following RFC 6266 best practice.static StringencodeContentDisposition(String filename, boolean inline, String userAgent) Deprecated, for removal: This API element is subject to removal in a future version.protected static voidencodeRFC2231(StringBuilder sb, String value) Encodes a value per RFC 2231, percent-encoding all non-attr-char bytes of the UTF-8 representation.static voidpercentEscape(StringBuilder sb, String value) Deprecated, for removal: This API element is subject to removal in a future version.since 2025.18, not used anymore
-
Method Details
-
percentEscape
@Deprecated(since="2025.18", forRemoval=true) public static void percentEscape(StringBuilder sb, String value) Deprecated, for removal: This API element is subject to removal in a future version.since 2025.18, not used anymore -
encodeRFC2231
Encodes a value per RFC 2231, percent-encoding all non-attr-char bytes of the UTF-8 representation.- Parameters:
sb- the buffer to append the encoded value tovalue- the value to encode
-
encodeContentDisposition
Encodes aContent-Dispositionheader following RFC 6266 best practice. When encoding is needed, bothfilename(raw fallback) andfilename*(RFC 2231 encoded) parameters are included.- Parameters:
filename- the filenameinline-truefor an inline disposition,falsefor an attachment- Returns:
- a full string to set as value of a
Content-Dispositionheader - Since:
- 2025.18
-
encodeContentDisposition
@Deprecated(since="2025.18", forRemoval=true) public static String encodeContentDisposition(String filename, boolean inline, String userAgent) Deprecated, for removal: This API element is subject to removal in a future version.since 2025.18, useencodeContentDisposition(String, boolean)instead
-
encodeContentDisposition(String, boolean)instead