diff --git a/core/src/main/java/org/verapdf/model/impl/axl/AXLMainXMPPackage.java b/core/src/main/java/org/verapdf/model/impl/axl/AXLMainXMPPackage.java index b2b71ddc4..e1519cd62 100644 --- a/core/src/main/java/org/verapdf/model/impl/axl/AXLMainXMPPackage.java +++ b/core/src/main/java/org/verapdf/model/impl/axl/AXLMainXMPPackage.java @@ -76,28 +76,20 @@ public List getLinkedObjects(String link) { private List getUAIdentification() { VeraPDFMeta xmpMetadata = this.getXmpMetadata(); - if (xmpMetadata != null) { - for (VeraPDFXMPNode node : xmpMetadata.getProperties()) { - if (XMPConst.NS_PDFUA_ID.equals(node.getNamespaceURI())) { - List res = new ArrayList<>(1); - res.add(new AXLPDFUAIdentification(xmpMetadata)); - return Collections.unmodifiableList(res); - } - } + if (xmpMetadata != null && xmpMetadata.containsPropertiesFromNamespace(XMPConst.NS_PDFUA_ID)) { + List res = new ArrayList<>(1); + res.add(new AXLPDFUAIdentification(xmpMetadata)); + return Collections.unmodifiableList(res); } return Collections.emptyList(); } private List getIdentification() { VeraPDFMeta xmpMetadata = this.getXmpMetadata(); - if (xmpMetadata != null) { - for (VeraPDFXMPNode node : xmpMetadata.getProperties()) { - if (XMPConst.NS_PDFA_ID.equals(node.getNamespaceURI())) { - List res = new ArrayList<>(1); - res.add(new AXLPDFAIdentification(xmpMetadata)); - return Collections.unmodifiableList(res); - } - } + if (xmpMetadata != null && xmpMetadata.containsPropertiesFromNamespace(XMPConst.NS_PDFA_ID)) { + List res = new ArrayList<>(1); + res.add(new AXLPDFAIdentification(xmpMetadata)); + return Collections.unmodifiableList(res); } return Collections.emptyList(); } diff --git a/core/src/main/java/org/verapdf/model/impl/axl/AXLPDFUAIdentification.java b/core/src/main/java/org/verapdf/model/impl/axl/AXLPDFUAIdentification.java index 24f77a4e4..52d23f371 100644 --- a/core/src/main/java/org/verapdf/model/impl/axl/AXLPDFUAIdentification.java +++ b/core/src/main/java/org/verapdf/model/impl/axl/AXLPDFUAIdentification.java @@ -13,8 +13,7 @@ public class AXLPDFUAIdentification extends AXLXMPObject implements PDFUAIdentif public static final String PDFUA_IDENTIFICATION = "PDFUAIdentification"; - private static final Logger LOGGER = Logger - .getLogger(AXLPDFUAIdentification.class.getName()); + private static final Logger LOGGER = Logger.getLogger(AXLPDFUAIdentification.class.getName()); private final VeraPDFMeta metadata; diff --git a/core/src/main/java/org/verapdf/processor/BatchFileProcessor.java b/core/src/main/java/org/verapdf/processor/BatchFileProcessor.java index 989837cad..57c134bf3 100644 --- a/core/src/main/java/org/verapdf/processor/BatchFileProcessor.java +++ b/core/src/main/java/org/verapdf/processor/BatchFileProcessor.java @@ -130,7 +130,14 @@ private void configLogs() { private void debugAndLog(String fileName) { if (this.processor.getConfig().getValidatorConfig().isDebug()) { - logger.log(Level.WARNING, fileName); + Level level = this.processor.getConfig().getValidatorConfig().getLoggingLevel(); + if (level.intValue() > Level.INFO.intValue()) { + LogsFileHandler.setLoggingLevel(Level.INFO); + } + logger.log(Level.INFO, fileName); + if (level.intValue() > Level.INFO.intValue()) { + LogsFileHandler.setLoggingLevel(level); + } } if (this.processor.getConfig().getValidatorConfig().isLogsEnabled()) { try { diff --git a/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java b/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java index 6dc137c45..155ab6bd6 100644 --- a/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java +++ b/xmp-core/src/main/java/org/verapdf/xmp/impl/VeraPDFMeta.java @@ -145,6 +145,15 @@ private boolean deleteSchema(String schemaNS) { return isDeleted; } + public boolean containsPropertiesFromNamespace(String nameSpaceURI) { + for (VeraPDFXMPNode node : getProperties()) { + if (nameSpaceURI.equals(node.getNamespaceURI())) { + return true; + } + } + return false; + } + private VeraPDFMeta setSimpleTextProperty(String namespaceURI, String propertyName, String value) throws XMPException { if (value == null) { this.meta.deleteProperty(namespaceURI, propertyName);