public final class PolicyChecker extends Object
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
allowedExtensions
A
List of allowed extensions for the passed schmeatron rules. |
static String |
SCHEMA_EXT |
static String |
XSL_EXT |
static String |
XSLT_EXT |
| Modifier and Type | Method and Description |
|---|---|
static void |
applyPolicy(File policy,
InputStream xmlReport,
OutputStream policyReport)
Apply a veraPDF policy expressed as schematron to a veraPDF report.
|
static void |
applyPolicy(InputStream policy,
InputStream xmlReport,
OutputStream policyReport,
boolean isXsl)
Apply a veraPDF policy expressed as schematron to a veraPDF report.
|
static void |
insertPolicyReport(File policyReport,
File mrrReport,
OutputStream mergedReport)
Adds a policy report to a veraPDF machine readable report instance,
effectively a merge carried out by an XSLT transform.
|
static boolean |
isAllowedExtension(String ext)
Check if an extenstion is an allowed policy file extension
|
static boolean |
isFilenameAllowedExtension(String filename)
Check if a filename has an allowed policy file extension
|
public static final String SCHEMA_EXT
public static final String XSL_EXT
public static final String XSLT_EXT
public static final List<String> allowedExtensions
List of allowed extensions for the passed schmeatron rules.
These can be:
public static void insertPolicyReport(File policyReport, File mrrReport, OutputStream mergedReport) throws VeraPDFException
policyReport - the XML policy report File to add to the machine
readable report.mrrReport - the XML machine readable report File to add the policy
report tomergedReport - and OutputStream destination for the merged report.VeraPDFException - when there's an error merging the reports.public static void applyPolicy(File policy, InputStream xmlReport, OutputStream policyReport) throws VeraPDFException
policy - a File that is either a raw schematron file (.sch
extenstion) or pre-compiled schematron file (.xsl or .xslt
extenstion), see allowedExtensionsxmlReport - an InputStream for the veraPDF XML report to apply
policy topolicyReport - an OutputStream to which the ouptut policy file will
be writtenVeraPDFException - when there's a problem applying the policy schematron rules.public static boolean isFilenameAllowedExtension(String filename)
filename - the filename to checkpublic static boolean isAllowedExtension(String ext)
ext - the extension to checkpublic static void applyPolicy(InputStream policy, InputStream xmlReport, OutputStream policyReport, boolean isXsl) throws VeraPDFException
policy - an InputStream for either raw schematron or
pre-compiled schematron XSL.xmlReport - an InputStream for the veraPDF XML report to apply
policy topolicyReport - an OutputStream to which the ouptut policy file will
be writtenisXsl - set true if the policy stream is a
pre-compiled XSL policy document, false if it's a raw
Schematron document.VeraPDFException - when there's a problem applying the policy schematron rules.Copyright © 2015–2017 The veraPDF Consortium. All rights reserved.