Package com.avoka.fc.core.util
Class ContentTypeUtils
- java.lang.Object
-
- com.avoka.fc.core.util.ContentTypeUtils
-
public class ContentTypeUtils extends Object
Provides utility methods around submission content types.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_TYPE_APPLICATION_JSON
Application Json content typestatic String
CONTENT_TYPE_APPLICATION_PDF
PDF content typestatic String
CONTENT_TYPE_APPLICATION_XDP_XML
XDP content typestatic String
CONTENT_TYPE_APPLICATION_XML
Application XML content typestatic String
CONTENT_TYPE_FORM_URLENCODED
Form url encoded content typestatic String
CONTENT_TYPE_TEXT_XML
Text XML content typestatic String[]
CONTENT_TYPES
Content types list
-
Constructor Summary
Constructors Constructor Description ContentTypeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isHtmlSubmission(String contentType)
Returns whether a content type indicates a submission of a HTML form.static boolean
isPdfSubmission(String contentType)
Returns whether a content type indicates a submission of PDF data.static boolean
isXdpSubmission(String contentType)
Returns whether a content type indicates a submission of XDP data.static boolean
isXmlSubmission(String contentType)
Returns whether a content type indicates a submission of XML-based data.
-
-
-
Field Detail
-
CONTENT_TYPE_APPLICATION_PDF
public static final String CONTENT_TYPE_APPLICATION_PDF
PDF content type- See Also:
- Constant Field Values
-
CONTENT_TYPE_APPLICATION_XDP_XML
public static final String CONTENT_TYPE_APPLICATION_XDP_XML
XDP content type- See Also:
- Constant Field Values
-
CONTENT_TYPE_APPLICATION_XML
public static final String CONTENT_TYPE_APPLICATION_XML
Application XML content type- See Also:
- Constant Field Values
-
CONTENT_TYPE_APPLICATION_JSON
public static final String CONTENT_TYPE_APPLICATION_JSON
Application Json content type- See Also:
- Constant Field Values
-
CONTENT_TYPE_FORM_URLENCODED
public static final String CONTENT_TYPE_FORM_URLENCODED
Form url encoded content type- See Also:
- Constant Field Values
-
CONTENT_TYPE_TEXT_XML
public static final String CONTENT_TYPE_TEXT_XML
Text XML content type- See Also:
- Constant Field Values
-
CONTENT_TYPES
public static final String[] CONTENT_TYPES
Content types list
-
-
Method Detail
-
isXmlSubmission
public static boolean isXmlSubmission(String contentType)
Returns whether a content type indicates a submission of XML-based data. Note that XDP submissions also return true.- Parameters:
contentType
- the content type- Returns:
- true if an XML related content type is detected (
CONTENT_TYPE_APPLICATION_XDP_XML
,CONTENT_TYPE_APPLICATION_XML
andCONTENT_TYPE_TEXT_XML
)
-
isXdpSubmission
public static boolean isXdpSubmission(String contentType)
Returns whether a content type indicates a submission of XDP data.- Parameters:
contentType
- the content type- Returns:
- true if the XDP related content type is detected (
CONTENT_TYPE_APPLICATION_XDP_XML
)
-
isPdfSubmission
public static boolean isPdfSubmission(String contentType)
Returns whether a content type indicates a submission of PDF data.- Parameters:
contentType
- the content type- Returns:
- true if the PDF related content type is detected (
CONTENT_TYPE_APPLICATION_PDF
)
-
isHtmlSubmission
public static boolean isHtmlSubmission(String contentType)
Returns whether a content type indicates a submission of a HTML form.- Parameters:
contentType
- the content type- Returns:
- true if the HTML form related content type is detected (
CONTENT_TYPE_FORM_URLENCODED
)
-
-