Package org.verapdf.apps.utils
Class ApplicationUtils
- java.lang.Object
-
- org.verapdf.apps.utils.ApplicationUtils
-
public final class ApplicationUtils extends Object
- Version:
- 0.1 Created 26 May 2017:14:37:56
- Author:
- Carl Wilson carlwilson AT github
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.static List<File>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 Detail
-
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 extenstions
- Throws:
IllegalArgumentException- when toFilter is null
-
doAllFilesExist
public static boolean doAllFilesExist(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.- 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
public static boolean isLegalExtension(List<File> toCheck, String[] extensions)
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
-
-