![]() |
filechampion4j 0.9.8.3
File validation library for Java
|

Public Member Functions | |
| Extensions (JSONObject jsonObject) | |
| Object | getValidationValue (String category, String extension, String validationKey) |
Private Member Functions | |
| void | logInfo (String message) |
| void | logWarn (String message) |
| void | logFine (String message) |
| void | mapConfiguredExtensions () |
| void | mapExtensionValidations () |
| void | setString (String validation, Object value) |
| void | setBoolean (String validation, Object value) |
| void | setArrayList (String validation, Object value) |
| void | checkInputs (String category, String extension, String validationKey) |
Private Attributes | |
| StringBuilder | sbLogMessage = new StringBuilder() |
| Map< String, Map< String, Object > > | categoriesMap |
| Map< String, Map< String, Object > > | extensionsMap |
| Map< String, Object > | validationsMap |
| Map< String, Object > | validationCache = new HashMap<>() |
| String | sharedMessage1 = "Unsupported value type: " |
| String | sharedMessage2 = " for key: " |
| List< String > | allowedKeyValues |
| List< String > | stringKeyValues |
| List< String > | boolKeyValues = Arrays.asList("change_ownership", "name_encoding", "add_checksum", "fail_fast") |
Static Private Attributes | |
| static final Logger | LOGGER = Logger.getLogger(Extensions.class.getName()) |
This class is used to load the Validations json objectand provide the validation values for a given extension.
Definition at line 16 of file Extensions.java.
| dev.filechampion.filechampion4j.Extensions.Extensions | ( | JSONObject | jsonObject | ) |
Constructor for Extensions class
| jsonObject | (JSONObject) - The json object containing the validations |
| IllegalArgumentException | if any of the json objects is invalid |
Definition at line 55 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.categoriesMap, dev.filechampion.filechampion4j.Extensions.extensionsMap, dev.filechampion.filechampion4j.Extensions.logFine(), dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), dev.filechampion.filechampion4j.Extensions.sbLogMessage, and dev.filechampion.filechampion4j.Extensions.validationsMap.

|
private |
Checks input parameters of getValidationValue method
| category | (String) - The category of the extension |
| extension | (String) - The extension to get the validation value for |
| validationKey | (String) - The validation key to get the value for |
Definition at line 201 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.categoriesMap, dev.filechampion.filechampion4j.Extensions.logWarn(), and dev.filechampion.filechampion4j.Extensions.sbLogMessage.
Referenced by dev.filechampion.filechampion4j.Extensions.getValidationValue().


| Object dev.filechampion.filechampion4j.Extensions.getValidationValue | ( | String | category, |
| String | extension, | ||
| String | validationKey | ||
| ) |
Returns the validation value for a given extension
| category | (String) - The category of the extension |
| extension | (String) - The file extension (without the dot) |
| validationKey | (String) - The validation key |
| IllegalArgumentException | if any of the parameters are invalid |
Definition at line 229 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.categoriesMap, dev.filechampion.filechampion4j.Extensions.checkInputs(), dev.filechampion.filechampion4j.Extensions.logFine(), dev.filechampion.filechampion4j.Extensions.sbLogMessage, and dev.filechampion.filechampion4j.Extensions.validationCache.
Referenced by dev.filechampion.filechampion4j.ValidationsHelper.checkFileSize(), dev.filechampion.filechampion4j.ValidationsHelper.checkMimeType(), dev.filechampion.filechampion4j.ValidationsHelper.containsFooterSignatures(), dev.filechampion.filechampion4j.ValidationsHelper.containsHeaderSignatures(), dev.filechampion.filechampion4j.ValidationsHelper.containsMagicBytes(), dev.filechampion.filechampion4j.FileValidator.doValidations(), dev.filechampion.filechampion4j.FileValidator.executeAfterPlugins(), dev.filechampion.filechampion4j.FileValidator.executeAfterPluginsProcess(), dev.filechampion.filechampion4j.FileValidator.executeBeforePlugins(), dev.filechampion.filechampion4j.ValidationsHelper.getValidationResults(), dev.filechampion.filechampion4j.FileValidator.saveFileToOutputDir(), and dev.filechampion.filechampion4j.FileValidator.validateFileMain().


|
private |
Definition at line 28 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.LOGGER.
Referenced by dev.filechampion.filechampion4j.Extensions.Extensions(), dev.filechampion.filechampion4j.Extensions.getValidationValue(), dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), and dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().

|
private |
Definition at line 18 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.LOGGER.
Referenced by dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().

|
private |
Definition at line 23 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.LOGGER.
Referenced by dev.filechampion.filechampion4j.Extensions.checkInputs(), dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), dev.filechampion.filechampion4j.Extensions.mapExtensionValidations(), dev.filechampion.filechampion4j.Extensions.setArrayList(), dev.filechampion.filechampion4j.Extensions.setBoolean(), and dev.filechampion.filechampion4j.Extensions.setString().

|
private |
Load extensions from json object into extensionsMap
Definition at line 80 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.categoriesMap, dev.filechampion.filechampion4j.Extensions.extensionsMap, dev.filechampion.filechampion4j.Extensions.logFine(), dev.filechampion.filechampion4j.Extensions.logWarn(), dev.filechampion.filechampion4j.Extensions.mapExtensionValidations(), dev.filechampion.filechampion4j.Extensions.sbLogMessage, dev.filechampion.filechampion4j.Extensions.sharedMessage1, and dev.filechampion.filechampion4j.Extensions.sharedMessage2.
Referenced by dev.filechampion.filechampion4j.Extensions.Extensions().


|
private |
Load extension validations into validationsMap
Definition at line 108 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.allowedKeyValues, dev.filechampion.filechampion4j.Extensions.categoriesMap, dev.filechampion.filechampion4j.Extensions.extensionsMap, dev.filechampion.filechampion4j.Extensions.logFine(), dev.filechampion.filechampion4j.Extensions.logInfo(), dev.filechampion.filechampion4j.Extensions.logWarn(), dev.filechampion.filechampion4j.Extensions.sbLogMessage, dev.filechampion.filechampion4j.Extensions.setArrayList(), dev.filechampion.filechampion4j.Extensions.setBoolean(), dev.filechampion.filechampion4j.Extensions.setString(), dev.filechampion.filechampion4j.Extensions.sharedMessage1, dev.filechampion.filechampion4j.Extensions.sharedMessage2, and dev.filechampion.filechampion4j.Extensions.validationsMap.
Referenced by dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions().


|
private |
Sets the value of ArrayList validation key
| validation | (String) - The validation key |
| value | (Object) - The value of the validation key |
Definition at line 182 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.logWarn(), dev.filechampion.filechampion4j.Extensions.sbLogMessage, dev.filechampion.filechampion4j.Extensions.sharedMessage1, dev.filechampion.filechampion4j.Extensions.sharedMessage2, and dev.filechampion.filechampion4j.Extensions.validationsMap.
Referenced by dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().


|
private |
Sets the value of Boolean validation key
| validation | (String) - The validation key |
| value | (Object) - The value of the validation key |
Definition at line 164 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.boolKeyValues, dev.filechampion.filechampion4j.Extensions.logWarn(), dev.filechampion.filechampion4j.Extensions.sbLogMessage, dev.filechampion.filechampion4j.Extensions.sharedMessage1, dev.filechampion.filechampion4j.Extensions.sharedMessage2, and dev.filechampion.filechampion4j.Extensions.validationsMap.
Referenced by dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().


|
private |
Sets the value of String validation key
| validation | (String) - The validation key |
| value | (Object) - The value of the validation key |
Definition at line 146 of file Extensions.java.
References dev.filechampion.filechampion4j.Extensions.logWarn(), dev.filechampion.filechampion4j.Extensions.sbLogMessage, dev.filechampion.filechampion4j.Extensions.sharedMessage1, dev.filechampion.filechampion4j.Extensions.sharedMessage2, dev.filechampion.filechampion4j.Extensions.stringKeyValues, and dev.filechampion.filechampion4j.Extensions.validationsMap.
Referenced by dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().


|
private |
Definition at line 42 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().
|
private |
Definition at line 48 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.setBoolean().
|
private |
Definition at line 35 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.Extensions(), dev.filechampion.filechampion4j.Extensions.checkInputs(), dev.filechampion.filechampion4j.Extensions.getValidationValue(), dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), and dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().
|
private |
Definition at line 36 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.Extensions(), dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), and dev.filechampion.filechampion4j.Extensions.mapExtensionValidations().
|
staticprivate |
Definition at line 17 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.logFine(), dev.filechampion.filechampion4j.Extensions.logInfo(), and dev.filechampion.filechampion4j.Extensions.logWarn().
|
private |
Definition at line 34 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.Extensions(), dev.filechampion.filechampion4j.Extensions.checkInputs(), dev.filechampion.filechampion4j.Extensions.getValidationValue(), dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), dev.filechampion.filechampion4j.Extensions.mapExtensionValidations(), dev.filechampion.filechampion4j.Extensions.setArrayList(), dev.filechampion.filechampion4j.Extensions.setBoolean(), and dev.filechampion.filechampion4j.Extensions.setString().
|
private |
Definition at line 39 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), dev.filechampion.filechampion4j.Extensions.mapExtensionValidations(), dev.filechampion.filechampion4j.Extensions.setArrayList(), dev.filechampion.filechampion4j.Extensions.setBoolean(), and dev.filechampion.filechampion4j.Extensions.setString().
|
private |
Definition at line 40 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.mapConfiguredExtensions(), dev.filechampion.filechampion4j.Extensions.mapExtensionValidations(), dev.filechampion.filechampion4j.Extensions.setArrayList(), dev.filechampion.filechampion4j.Extensions.setBoolean(), and dev.filechampion.filechampion4j.Extensions.setString().
|
private |
Definition at line 45 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.setString().
|
private |
Definition at line 38 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.getValidationValue().
|
private |
Definition at line 37 of file Extensions.java.
Referenced by dev.filechampion.filechampion4j.Extensions.Extensions(), dev.filechampion.filechampion4j.Extensions.mapExtensionValidations(), dev.filechampion.filechampion4j.Extensions.setArrayList(), dev.filechampion.filechampion4j.Extensions.setBoolean(), and dev.filechampion.filechampion4j.Extensions.setString().