public class SanityChecker extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_PARAMETER_VALUE |
Modifier and Type | Method and Description |
---|---|
static void |
checkHeaders(javax.ws.rs.core.HttpHeaders headers)
checkHeaders : Check sanity of Headers: no javascript/xml tag, neither html tag
|
static void |
checkHeadersMap(javax.ws.rs.core.MultivaluedMap<String,String> requestHeaders)
Checks sanity of Headers: no javascript/xml tag, neither html tag
|
static void |
checkHTMLFile(File file)
checkHTMLFile : Check if the file contains HTML content
|
static void |
checkJsonAll(com.fasterxml.jackson.databind.JsonNode json)
checkJsonAll : Check sanity of json : size, invalid tag
|
static void |
checkJsonAll(String json)
checkJsonAll : Check sanity of json : size, invalid tag
|
protected static void |
checkJsonSanity(com.fasterxml.jackson.databind.JsonNode json)
checkJsonSanity : check sanity of json and find invalid key
|
static void |
checkParameter(String... params)
checkParameter : Check sanity of String: no javascript/xml tag, neither html tag
|
static void |
checkUriParametersMap(javax.ws.rs.core.MultivaluedMap<String,String> uriParameters)
Checks sanity of Headers: no javascript/xml tag, neither html tag
|
static void |
checkXmlAll(File xmlFile)
checkXMLAll : check xml sanity all aspect : size, tag size, invalid tag
|
protected static void |
checkXmlSanityFileSize(File xmlFile)
CheckXMLSanityFileSize : check size of xml file
|
protected static void |
checkXmlSanityTags(File xmlFile)
CheckXMLSanityTags : check invalid tag contains of a xml file
|
protected static void |
checkXmlSanityTagValueSize(File xmlFile)
check XML Sanity Tag and Value Size
|
static int |
getLimitFieldSize() |
static long |
getLimitFileSize() |
static long |
getLimitJsonSize() |
static int |
getLimitParamSize() |
static boolean |
isValidFileName(String value) |
static String |
sanitizeJson(com.fasterxml.jackson.databind.JsonNode json)
Sabitize the json
|
static void |
setLimitFieldSize(int limitFieldSize) |
static void |
setLimitFileSize(long limitFileSize) |
static void |
setLimitJsonSize(long limitJsonSize) |
static void |
setLimitParamSize(int limitParamSize) |
public static final String HTTP_PARAMETER_VALUE
public static boolean isValidFileName(String value)
public static final void checkXmlAll(File xmlFile) throws InvalidParseOperationException, IOException
xmlFile
- as FileInvalidParseOperationException
- when parse file errorIOException
- when read file errorInvalidParseOperationException
- when Sanity Check is in errorpublic static final String sanitizeJson(com.fasterxml.jackson.databind.JsonNode json) throws InvalidParseOperationException
json
- InvalidParseOperationException
public static final void checkJsonAll(com.fasterxml.jackson.databind.JsonNode json) throws InvalidParseOperationException
json
- as JsonNodeInvalidParseOperationException
- when Sanity Check is in errorpublic static final void checkJsonAll(String json) throws InvalidParseOperationException
json
- as StringInvalidParseOperationException
- when Sanity Check is in errorpublic static final void checkParameter(String... params) throws InvalidParseOperationException
params
- InvalidParseOperationException
public static final void checkHTMLFile(File file) throws InvalidParseOperationException, IOException
file
- InvalidParseOperationException
IOException
public static final void checkHeaders(javax.ws.rs.core.HttpHeaders headers) throws InvalidParseOperationException
headers
- InvalidParseOperationException
public static final void checkHeadersMap(javax.ws.rs.core.MultivaluedMap<String,String> requestHeaders) throws InvalidParseOperationException
requestHeaders
- InvalidParseOperationException
public static final void checkUriParametersMap(javax.ws.rs.core.MultivaluedMap<String,String> uriParameters) throws InvalidParseOperationException
uriParameters
- InvalidParseOperationException
protected static final void checkXmlSanityTagValueSize(File xmlFile) throws InvalidParseOperationException, IOException
xmlFile
- xml fileIOException
- when read file errorInvalidParseOperationException
- when Sanity Check is in errorprotected static final void checkXmlSanityFileSize(File xmlFile) throws InvalidParseOperationException
xmlFile
- as FileIOException
- when read file exceptionInvalidParseOperationException
- when Sanity Check is in errorprotected static final void checkXmlSanityTags(File xmlFile) throws InvalidParseOperationException, IOException
xmlFile
- : XML file path as StringIOException
- when read file errorInvalidParseOperationException
- when Sanity Check is in errorprotected static final void checkJsonSanity(com.fasterxml.jackson.databind.JsonNode json) throws InvalidParseOperationException
json
- as JsonNodeInvalidParseOperationException
- when Sanity Check is in errorpublic static final long getLimitFileSize()
public static final void setLimitFileSize(long limitFileSize)
limitFileSize
- the limit File Size to set (XML or JSON)public static final long getLimitJsonSize()
public static final void setLimitJsonSize(long limitJsonSize)
limitJsonSize
- the limit Size of a Json to setpublic static final int getLimitFieldSize()
public static final void setLimitFieldSize(int limitFieldSize)
limitFieldSize
- the limit Size of a Field in a Json to setpublic static final int getLimitParamSize()
public static final void setLimitParamSize(int limitParamSize)
limitParamSize
- the limit Size of a parameter to setCopyright © 2018 Vitam. All rights reserved.