Class ContentTypeUtils
- java.lang.Object
-
- org.activiti.cloud.services.common.util.ContentTypeUtils
-
public final class ContentTypeUtils extends Object
Utils for handling content type
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_TYPE_JSONstatic StringCONTENT_TYPE_SVGstatic StringCONTENT_TYPE_XMLstatic StringCONTENT_TYPE_ZIPstatic Map<String,String>CONTENT_TYPESstatic StringDMNstatic charEXTENSION_SEPARATORstatic StringJSONstatic StringXML
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringfullExtension(String extension)static Optional<String>getContentTypeByExtension(String extension)Get the content type corresponding to an extension.static Optional<String>getContentTypeByPath(String path)Get the content type corresponding to a path.static booleanisJsonContentType(String contentType)Check if a content type is jsonstatic StringremoveExtension(String filename, String extension)static StringsetExtension(String filename, String extension)static StringtoJsonFilename(String filename)
-
-
-
Field Detail
-
JSON
public static final String JSON
- See Also:
- Constant Field Values
-
DMN
public static final String DMN
- See Also:
- Constant Field Values
-
XML
public static final String XML
- See Also:
- Constant Field Values
-
CONTENT_TYPE_JSON
public static final String CONTENT_TYPE_JSON
-
CONTENT_TYPE_XML
public static final String CONTENT_TYPE_XML
-
CONTENT_TYPE_SVG
public static final String CONTENT_TYPE_SVG
- See Also:
- Constant Field Values
-
CONTENT_TYPE_ZIP
public static final String CONTENT_TYPE_ZIP
- See Also:
- Constant Field Values
-
EXTENSION_SEPARATOR
public static final char EXTENSION_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getContentTypeByExtension
public static Optional<String> getContentTypeByExtension(String extension)
Get the content type corresponding to an extension.- Parameters:
extension- the extension to search the content type for- Returns:
- the content type
-
getContentTypeByPath
public static Optional<String> getContentTypeByPath(String path)
Get the content type corresponding to a path.- Parameters:
path- the path to search the content type for- Returns:
- the content type
-
isJsonContentType
public static boolean isJsonContentType(String contentType)
Check if a content type is json- Parameters:
contentType- the content type to check- Returns:
- true if the the given content type is json
-
-