Package org.verapdf.apps.utils
Class ApplicationUtils
java.lang.Object
org.verapdf.apps.utils.ApplicationUtils
- Version:
- 0.1 Created 26 May 2017:14:37:56
- Author:
- Carl Wilson carlwilson AT github
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleandoAllFilesExist(List<File> toCheck) Checks all files in a list to ensure that they exist and returns true if and only if all files in the list exist.filterPdfFiles(List<File> toFilter, boolean isRecursive, boolean nonPdfExt) Filters the passed list files by removing all files without a ".pdf" extension.static booleanisLegalExtension(List<File> toCheck, String[] extensions) Checks a list of files to ensure that they all have an extension supplied in the list of extensionsstatic FeatureExtractorConfigmergeEnabledFeaturesFromPolicy(FeatureExtractorConfig currentConfig, InputStream policy)
-
Method Details
-
filterPdfFiles
public static List<File> filterPdfFiles(List<File> toFilter, boolean isRecursive, boolean nonPdfExt) Filters the passed list files by removing all files without a ".pdf" extension.- Parameters:
toFilter- the list of files to filter, can not be null- Returns:
- an immutable list of the filtered files, i.e. all PDF extensions
- Throws:
IllegalArgumentException- when toFilter is null
-
doAllFilesExist
Checks all files in a list to ensure that they exist and returns true if and only if all files in the list exist.- Parameters:
toCheck- the list of files to test- Returns:
- true if all files in the list exist, otherwise false.
- Throws:
IllegalArgumentException- when toCheck is null
-
isLegalExtension
Checks a list of files to ensure that they all have an extension supplied in the list of extensions- Parameters:
toCheck- the list of files to check the extensions ofextensions- the list of allowed extensions- Returns:
- true if all files in toCheck have an extension listed in extensions
- Throws:
IllegalArgumentException- when toCheck is null
-
mergeEnabledFeaturesFromPolicy
public static FeatureExtractorConfig mergeEnabledFeaturesFromPolicy(FeatureExtractorConfig currentConfig, InputStream policy) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException
-