Package org.cyclos.utils
Enum ContentType
- java.lang.Object
-
- java.lang.Enum<ContentType>
-
- org.cyclos.utils.ContentType
-
- All Implemented Interfaces:
Serializable,Comparable<ContentType>
public enum ContentType extends Enum<ContentType>
Contains the possible generated content types
-
-
Field Summary
Fields Modifier and Type Field Description static intMIN_GZIP_LENGTH9 is the minimum length for a valid GZIP file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContentTypegetByExtension(String extension)Returns a content type by extension, or null if none foundstatic ContentTypegetByFileName(String fileName)Returns a content type by file name, or null if none foundstatic ContentTypegetByMimeType(String mimeType)Returns a content type by mime type, or null if none foundStringgetExtension()StringgetMimeType()booleanisBinary()static ContentTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ContentType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TEXT
public static final ContentType TEXT
-
HTML
public static final ContentType HTML
-
XML
public static final ContentType XML
-
CSS
public static final ContentType CSS
-
JSON
public static final ContentType JSON
-
YAML
public static final ContentType YAML
-
JAVASCRIPT
public static final ContentType JAVASCRIPT
-
CSV
public static final ContentType CSV
-
JPEG
public static final ContentType JPEG
-
GIF
public static final ContentType GIF
-
PNG
public static final ContentType PNG
-
WEBP
public static final ContentType WEBP
-
PDF
public static final ContentType PDF
-
ZIP
public static final ContentType ZIP
-
SVG
public static final ContentType SVG
-
TTF
public static final ContentType TTF
-
OTF
public static final ContentType OTF
-
WOFF
public static final ContentType WOFF
-
WOFF2
public static final ContentType WOFF2
-
EOT
public static final ContentType EOT
-
BIN
public static final ContentType BIN
-
-
Method Detail
-
values
public static ContentType[] 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 (ContentType c : ContentType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ContentType 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
-
getByExtension
public static ContentType getByExtension(String extension)
Returns a content type by extension, or null if none found
-
getByFileName
public static ContentType getByFileName(String fileName)
Returns a content type by file name, or null if none found
-
getByMimeType
public static ContentType getByMimeType(String mimeType)
Returns a content type by mime type, or null if none found
-
getExtension
public String getExtension()
-
getMimeType
public String getMimeType()
-
isBinary
public boolean isBinary()
-
-