Class MimeTypeHelper


  • @Deprecated(since="2021-07-29")
    public class MimeTypeHelper
    extends java.lang.Object
    Deprecated.
    This API is deprecated as Apache Abdera is a retired project since 2017.
    Utilities for working with MIME Media Types
    • Constructor Summary

      Constructors 
      Constructor Description
      MimeTypeHelper()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static int compare​(java.lang.String t1, java.lang.String t2)
      Deprecated.
      Compare two media types according to their relative level of specificity
      static int compare​(javax.activation.MimeType mt1, javax.activation.MimeType mt2)
      Deprecated.
      Compare two media types according to their relative level of specificity
      static java.lang.String[] condense​(java.lang.String... types)
      Deprecated.
      This will take an array of media types and will condense them based on wildcards, etc.
      static java.lang.String getCharset​(java.lang.String mediatype)
      Deprecated.
       
      static java.util.Comparator<java.lang.String> getComparator()
      Deprecated.
      Returns a Comparator that can be used to compare and sort MIME media types according to their level of specificity (e.g.
      static <T extends Base>
      java.lang.String
      getMimeType​(T base)
      Deprecated.
      Returns the appropriate media type for the given Abdera base
      static boolean isApp​(java.lang.String a)
      Deprecated.
      Returns true if media type a matches application/atomsrv+xml
      static boolean isAtom​(java.lang.String a)
      Deprecated.
      Returns true if media type a matches application/atom+xml
      static boolean isEntry​(java.lang.String a)
      Deprecated.
      Returns true if media type a specifically identifies an Atom entry document
      static boolean isFeed​(java.lang.String a)
      Deprecated.
      Returns true if media type a explicitly identifies an Atom feed document
      static boolean isMatch​(java.lang.String a, java.lang.String b)
      Deprecated.
      Returns true if media type a matches media type b
      static boolean isMatch​(javax.activation.MimeType a, javax.activation.MimeType b)
      Deprecated.
       
      static boolean isMatch​(javax.activation.MimeType a, javax.activation.MimeType b, boolean includeparams)
      Deprecated.
      Returns true if media type a matches media type b
      static boolean isMimeType​(java.lang.String a)
      Deprecated.
      Returns true if this is a valid media type
      static boolean isMultipart​(java.lang.String a)
      Deprecated.
      Returns true if media type is a multiparted file.
      static boolean isText​(java.lang.String a)
      Deprecated.
      Returns true if media type a matches text/*
      static boolean isXml​(java.lang.String a)
      Deprecated.
      Returns true if media type a matches application/xml, text/xml or application/*+xml
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MimeTypeHelper

        public MimeTypeHelper()
        Deprecated.
    • Method Detail

      • getCharset

        public static java.lang.String getCharset​(java.lang.String mediatype)
        Deprecated.
      • isMatch

        public static boolean isMatch​(java.lang.String a,
                                      java.lang.String b)
        Deprecated.
        Returns true if media type a matches media type b
      • isMatch

        public static boolean isMatch​(javax.activation.MimeType a,
                                      javax.activation.MimeType b)
        Deprecated.
      • isMatch

        public static boolean isMatch​(javax.activation.MimeType a,
                                      javax.activation.MimeType b,
                                      boolean includeparams)
        Deprecated.
        Returns true if media type a matches media type b
      • isApp

        public static boolean isApp​(java.lang.String a)
        Deprecated.
        Returns true if media type a matches application/atomsrv+xml
      • isAtom

        public static boolean isAtom​(java.lang.String a)
        Deprecated.
        Returns true if media type a matches application/atom+xml
      • isEntry

        public static boolean isEntry​(java.lang.String a)
        Deprecated.
        Returns true if media type a specifically identifies an Atom entry document
      • isFeed

        public static boolean isFeed​(java.lang.String a)
        Deprecated.
        Returns true if media type a explicitly identifies an Atom feed document
      • isXml

        public static boolean isXml​(java.lang.String a)
        Deprecated.
        Returns true if media type a matches application/xml, text/xml or application/*+xml
      • isText

        public static boolean isText​(java.lang.String a)
        Deprecated.
        Returns true if media type a matches text/*
      • isMimeType

        public static boolean isMimeType​(java.lang.String a)
        Deprecated.
        Returns true if this is a valid media type
      • getMimeType

        public static <T extends Base> java.lang.String getMimeType​(T base)
        Deprecated.
        Returns the appropriate media type for the given Abdera base
      • condense

        public static java.lang.String[] condense​(java.lang.String... types)
        Deprecated.
        This will take an array of media types and will condense them based on wildcards, etc. For instance, condense("image/png", "image/jpg", "image/*") condenses to [image/*] condense("application/atom", "application/*", "image/png", "image/*") condenses to [application/*, image/*]
      • getComparator

        public static java.util.Comparator<java.lang.String> getComparator()
        Deprecated.
        Returns a Comparator that can be used to compare and sort MIME media types according to their level of specificity (e.g. text/* is less specific than text/plain and would appear first in a sorted list)
      • compare

        public static int compare​(javax.activation.MimeType mt1,
                                  javax.activation.MimeType mt2)
        Deprecated.
        Compare two media types according to their relative level of specificity
      • compare

        public static int compare​(java.lang.String t1,
                                  java.lang.String t2)
        Deprecated.
        Compare two media types according to their relative level of specificity
      • isMultipart

        public static boolean isMultipart​(java.lang.String a)
        Deprecated.
        Returns true if media type is a multiparted file.