public static String getBoundary(MediaType contentType) {
        requireNonNull(contentType, "contentType");
        checkArgument(contentType.isMultipart(),
                      "Content-Type: %s (expected: multipart content type)", contentType);
        final List<String> boundary = contentType.parameters().get("boundary");

        if (boundary == null || boundary.isEmpty()) {
            throw new IllegalStateException("boundary parameter is missing on the Content-Type header");
        }
        return boundary.get(0);
    }
Extracts {@code boundary} parameter value from the multipart {@link MediaType}.
@param contentType {@link MediaType} that represents on of the multipart subtypes.
@return {@code boundary} parameter value extracted from the multipart {@link MediaType}.
@throws IllegalArgumentException if the specified {@link MediaType} is not multipart
@throws IllegalStateException if {@code boundary} parameter is missing on the specified {@link MediaType}
core/src/main/java/com/linecorp/armeria/common/multipart/Multiparts.java