All Superinterfaces:
Serializable

public interface MimeType extends Serializable
This class represents a simple immutable MIME type object. A mime type is made up of two parts <base type>/<sub type>. The base type can be something like application or text and the the sub type can be something like xml or plain.
Both the base type and sub type can also be the wild card * such as */* and text/*. Note, if the base type is the wild card then the sub type must also be a wild card.
Since:
5.0.100
  • Method Details

    • getExtension

      @Nullable @Nullable String getExtension()
      Get the associated filename extension. e.g. in case of myPdfFile.pdf the mime-type is 'application/pdf' and 'pdf' the filename extension.
      Returns:
      the filename extension string
      Since:
      5.0.100
    • getExtensions

      @NotNull @NotNull Collection<String> getExtensions()
      Get the possible associated filename extensions. e.g. in case of myJpgFile.jpg the mime-type is 'application/jp(e)g' and 'jpeg' or 'jpg' the filename extension.
      Returns:
      the filename extension string
      Since:
      5.0.209
    • getBaseType

      String getBaseType()
      Returns the base type. In case of 'application/pdf' it returns 'application'.
      Returns:
      the base type
      Since:
      5.0.100
    • getSubType

      String getSubType()
      Returns the sub type, means the concrete format. In case of 'application/pdf' it returns 'pdf'.
      Returns:
      the sub type
      Since:
      5.0.100
    • toString

      String toString()
      Returns a string representation of this object. e.g. 'application/pdf'
      Overrides:
      toString in class Object
      Returns:
      a string representation of this object
      Since:
      5.0.100