Skip to content

Commit

Permalink
Add StaticCoreContainers to library
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Jun 3, 2024
1 parent 47a8c00 commit 4dffc2e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package org.verapdf.model;

import org.verapdf.xmp.XMPException;
import org.verapdf.containers.StaticCoreContainers;
import org.verapdf.xmp.containers.StaticXmpCoreContainers;
import org.verapdf.xmp.impl.VeraPDFMeta;
import java.util.logging.Logger;
Expand Down Expand Up @@ -73,11 +74,13 @@ public final class ModelParser implements PDFAParser {
private ModelParser(final InputStream docStream, PDFAFlavour flavour, PDFAFlavour defaultFlavour) throws IOException {
this.document = PDDocument.load(docStream, false, true);
this.flavour = detectFlavour(this.document, flavour, defaultFlavour);
StaticCoreContainers.setFlavour(this.flavour);
}

private ModelParser(final File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour) throws IOException {
this.document = PDDocument.load(pdfFile, false, true);
this.flavour = detectFlavour(this.document, flavour, defaultFlavour);
StaticCoreContainers.setFlavour(this.flavour);
}

public static ModelParser createModelWithFlavour(InputStream toLoad, PDFAFlavour flavour)
Expand Down Expand Up @@ -158,6 +161,7 @@ private static PDFAFlavour obtainFlavour(PDDocument document, PDFAFlavour defaul

private static void cleanUp() {
StaticContainers.clearAllContainers();
StaticCoreContainers.clearAllContainers();
StaticXmpCoreContainers.clearAllContainers();
}

Expand Down

0 comments on commit 4dffc2e

Please sign in to comment.