public static ContentDisposition parse(String contentDisposition) {
        requireNonNull(contentDisposition, "contentDisposition");
        final List<String> parts = tokenize(contentDisposition);
        final String type = parts.get(0);
        String name = null;
        String filename = null;
        Charset charset = null;
        for (int i = 1; i < parts.size(); i++) {
            final String part = parts.get(i);
            final int eqIndex = part.indexOf('=');
            if (eqIndex != -1) {
                final String attribute = part.substring(0, eqIndex);
                final String value;
                if (part.startsWith("\"", eqIndex + 1) && part.endsWith("\"")) {
                    value = part.substring(eqIndex + 2, part.length() - 1);
                } else {
                    value = part.substring(eqIndex + 1);
                }

                if ("name".equals(attribute)) {
                    name = value;
                } else if ("filename*".equals(attribute)) {
                    final int idx1 = value.indexOf('\'');
                    final int idx2 = value.indexOf('\'', idx1 + 1);
                    if (idx1 != -1 && idx2 != -1) {
                        final String charsetString = value.substring(0, idx1).trim();
                        charset = supportedCharsets.getOrDefault(Ascii.toLowerCase(charsetString), ISO_8859_1);
                        filename = decodeFilename(value.substring(idx2 + 1), charset);
                    } else {
                        // US ASCII
                        filename = decodeFilename(value, StandardCharsets.US_ASCII);
                    }
                } else if ("filename".equals(attribute) && (filename == null)) {
                    filename = value;
                }
            } else {
                throw new IllegalArgumentException("Invalid content disposition format: " + contentDisposition);
            }
        }
        return new ContentDisposition(type, name, filename, charset);
    }
Parses a {@code "content-disposition"} header value as defined in RFC 2183.

<p>Note that only the US-ASCII, UTF-8 and ISO-8859-1 charsets are supported.
If other charsets are specified, ISO-8859-1 will be used instead.

@param contentDisposition the {@code "content-disposition"} header value
@return the parsed content disposition
@see #asHeaderValue()
core/src/main/java/com/linecorp/armeria/common/ContentDisposition.java