private static List<String> tokenize(String headerValue) {
        int index = headerValue.indexOf(';');
        final String type = (index >= 0 ? headerValue.substring(0, index) : headerValue).trim();
        checkArgument(!type.isEmpty(), "Content-Disposition header must not be empty");

        final ImmutableList.Builder<String> parts = ImmutableList.builderWithExpectedSize(4);
        parts.add(type);
        if (index >= 0) {
            do {
                int nextIndex = index + 1;
                boolean quoted = false;
                boolean escaped = false;
                while (nextIndex < headerValue.length()) {
                    final char ch = headerValue.charAt(nextIndex);
                    if (ch == ';') {
                        if (!quoted) {
                            break;
                        }
                    } else if (!escaped && ch == '"') {
                        quoted = !quoted;
                    }
                    escaped = !escaped && ch == '\\';
                    nextIndex++;
                }
                final String part = headerValue.substring(index + 1, nextIndex).trim();
                if (!part.isEmpty()) {
                    parts.add(part);
                }
                index = nextIndex;
            }
            while (index < headerValue.length());
        }
        return parts.build();
    }
Returns the charset defined in {@code filename*} parameter, or {@code null} if not defined.
core/src/main/java/com/linecorp/armeria/common/ContentDisposition.java