public static boolean isMultipart(DiscFilterRequest request) {
        if (request == null) {
            return false;
        }

        String contentType = request.getContentType();

        if (contentType == null) {
            return false;
        }

        String[] parts = Pattern.compile(";").split(contentType);
        if (parts.length == 0) {
            return false;
        }

        for (String part : parts) {
            if ("multipart/form-data".equals(part)) {
                return true;
            }
        }

        return false;
    }
Can be called multiple times to add Cookies
container-core/src/main/java/com/yahoo/jdisc/http/filter/DiscFilterRequest.java