class ContentTypeCleaner {

    public static String cleanContentType(MimePart mimePart, String contentType) {
        if (Strings.isNullOrEmpty(contentType)) {
            return null;
        }

        if (REGEX.matcher(contentType).find()) {
            return contentType;
        }

        LOGGER.warn("Can not parse Content-Type: " + contentType);
        return null;
    }

}