Package com.helger.commons.mime
Enum EMimeContentType
- java.lang.Object
-
- java.lang.Enum<EMimeContentType>
-
- com.helger.commons.mime.EMimeContentType
-
- All Implemented Interfaces:
IHasID<String>,Serializable,Comparable<EMimeContentType>
public enum EMimeContentType extends Enum<EMimeContentType> implements IHasID<String>
Determines the most well known MIME content types.- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description _STARAPPLICATIONAUDIOCHEMICALEXAMPLEFLV_APPLICATIONFONTIMAGEINODEMESSAGEMODELMULTIPARTTEXTVIDEOWWWX_CONFERENCEX_CONTENTX_DIRECTORYX_EPOCX_WORLDZZ_APPLICATION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MimeTypebuildMimeType(String sContentSubType)Build a newMimeTypebased on this MIME content type and the provided sub type.static EMimeContentTypegetFromIDOrNull(String sID)StringgetID()Get the unique ID of this object.StringgetText()booleanisTypeOf(String sMimeType)Check if the passed MIME type has the same content type as thisstatic EMimeContentTypevalueOf(String name)Returns the enum constant of this type with the specified name.static EMimeContentType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
APPLICATION
public static final EMimeContentType APPLICATION
-
AUDIO
public static final EMimeContentType AUDIO
-
EXAMPLE
public static final EMimeContentType EXAMPLE
-
FONT
public static final EMimeContentType FONT
-
IMAGE
public static final EMimeContentType IMAGE
-
MESSAGE
public static final EMimeContentType MESSAGE
-
MODEL
public static final EMimeContentType MODEL
-
MULTIPART
public static final EMimeContentType MULTIPART
-
TEXT
public static final EMimeContentType TEXT
-
VIDEO
public static final EMimeContentType VIDEO
-
CHEMICAL
public static final EMimeContentType CHEMICAL
-
FLV_APPLICATION
public static final EMimeContentType FLV_APPLICATION
-
INODE
public static final EMimeContentType INODE
-
WWW
public static final EMimeContentType WWW
-
X_CONFERENCE
public static final EMimeContentType X_CONFERENCE
-
X_CONTENT
public static final EMimeContentType X_CONTENT
-
X_DIRECTORY
public static final EMimeContentType X_DIRECTORY
-
X_EPOC
public static final EMimeContentType X_EPOC
-
X_WORLD
public static final EMimeContentType X_WORLD
-
ZZ_APPLICATION
public static final EMimeContentType ZZ_APPLICATION
-
_STAR
public static final EMimeContentType _STAR
-
-
Method Detail
-
values
public static EMimeContentType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EMimeContentType c : EMimeContentType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EMimeContentType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getID
@Nonnull @Nonempty public String getID()
Description copied from interface:IHasIDGet the unique ID of this object. If the type isStringthan the returned value must match an XML NMToken expression (so e.g. no ':' in the ID)!
-
getText
@Nonnull @Nonempty public String getText()
- Returns:
- The lower case text representation of this MIME content type.
- See Also:
getID()
-
buildMimeType
@Nonnull public MimeType buildMimeType(@Nonnull @Nonempty String sContentSubType)
Build a newMimeTypebased on this MIME content type and the provided sub type.- Parameters:
sContentSubType- The content sub type to append. May neither benullnor empty.- Returns:
- Never
null.
-
isTypeOf
public boolean isTypeOf(@Nullable String sMimeType)
Check if the passed MIME type has the same content type as this- Parameters:
sMimeType- The MIME type string to be checked. May benull.- Returns:
trueif the passed MIME type has this content type,falseotherwise
-
getFromIDOrNull
@Nullable public static EMimeContentType getFromIDOrNull(@Nullable String sID)
-
-