Package org.zkoss.util.media
Class ContentTypes
java.lang.Object
org.zkoss.util.media.ContentTypes
Utilities relevant to content types.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringgetContentType(String format) Returns the content type of the specified format, such as "html" and "pdf", or null if not found (or format is null).static final StringReturns the format of the specified content type, or null if not found.static final booleanReturns whether the content type is binary.static final voidAdds additional binding of the format and content type.
-
Constructor Details
-
ContentTypes
protected ContentTypes()
-
-
Method Details
-
isBinary
Returns whether the content type is binary.- Parameters:
ctype- the content type, e.g., text/plain If ctype is null or empty, false is returned.- Since:
- 3.0.6
-
getContentType
Returns the content type of the specified format, such as "html" and "pdf", or null if not found (or format is null). -
getFormat
Returns the format of the specified content type, or null if not found.- Throws:
IllealArgumentException- if ctype is null
-
put
Adds additional binding of the format and content type.You rarely need to invoke this method, unless your format is not by the default mapping.
-