Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private void parseDocumentFeatures(PDDocument document) {
getCatalogFeatures(catalog);
}
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Problem in parsing document catalog", e);
LOGGER.log(Level.SEVERE, "Problem in parsing document catalog");
}

reporter.report(GFFeaturesObjectCreator.createLowLvlInfoFeaturesObject(cosDocument));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void init(PDColorSpace colorSpace) {
byte[] lookupData = GFAdapterHelper.inputStreamToByteArray(stream);
this.lookup = DatatypeConverter.printHexBinary(lookupData);
} catch (IOException e) {
LOGGER.log(Level.FINE, e.getMessage(), e);
LOGGER.log(Level.FINE, e.getMessage());
this.errors = new ArrayList<>();
this.errors.add("Problem during converting lookup value to hex string");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void init() {
}

} catch (IOException e) {
LOGGER.log(Level.FINE, "Reading byte array from InputStream error", e);
LOGGER.log(Level.FINE, "Reading byte array from InputStream error");
errors.add(e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private static MetadataFixerResult fixAndSaveDocument(OutputStream output, PDFDo

return getErrorResult("Problems with metadata obtain. No possibility to fix metadata.");
} catch (Throwable e) {
LOGGER.log(Level.FINE, "Error while fixing metadata", e);
LOGGER.log(Level.FINE, "Error while fixing metadata");
return getErrorResult("Error while fixing metadata: " + e.getMessage());
}
}
Expand All @@ -154,7 +154,7 @@ private static ValidationStatus getValidationStatus(ValidationResult result, Pro
try {
return ProcessedObjectsInspector.validationStatus(result.getTestAssertions(), profile, parser);
} catch (IOException | URISyntaxException | ParserConfigurationException | SAXException e) {
LOGGER.log(Level.FINE, "Problem with validation status obtain. Validation status set as Invalid Document.", e);
LOGGER.log(Level.FINE, "Problem with validation status obtain. Validation status set as Invalid Document.");
return ValidationStatus.INVALID_DOCUMENT;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void removePDFUAIdentificationSchema(MetadataFixerResultImpl.Builder resu
resultBuilder.status(MetadataFixerResult.RepairStatus.ID_REMOVED);
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification part.", e);
LOGGER.log(Level.FINE, "Can not obtain identification part.");
}
}

Expand Down Expand Up @@ -204,7 +204,7 @@ public void addPDFUAIdentificationSchema(MetadataFixerResultImpl.Builder resultB
XMPMetaFactory.getSchemaRegistry().registerNamespace(XMPConst.NS_PDFUA_ID, VeraPDFMeta.PDFUAID_PREFIX, false);
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not register " + XMPConst.NS_PDFUA_ID + " namespace.", e);
LOGGER.log(Level.FINE, "Can not register " + XMPConst.NS_PDFUA_ID + " namespace.");
}
boolean isBadPart = true;
boolean isMissingPart = false;
Expand All @@ -216,7 +216,7 @@ public void addPDFUAIdentificationSchema(MetadataFixerResultImpl.Builder resultB
isMissingPart = this.metadata.getPDFUAIdentificationPart() == null;
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification fields.", e);
LOGGER.log(Level.FINE, "Can not obtain identification fields.");
}
try {
if (isBadPart) {
Expand All @@ -226,7 +226,7 @@ public void addPDFUAIdentificationSchema(MetadataFixerResultImpl.Builder resultB
this.setNeedToBeUpdated(true);
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification fields.", e);
LOGGER.log(Level.FINE, "Can not obtain identification fields.");
}
}

Expand Down Expand Up @@ -259,7 +259,7 @@ public void updateExtensionSchema(MetadataFixerResultImpl.Builder resultBuilder,
this.setNeedToBeUpdated(true);
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain extension schema.", e);
LOGGER.log(Level.FINE, "Can not obtain extension schema.");
}
}

Expand Down Expand Up @@ -287,7 +287,7 @@ public void addPDFAIdentificationSchema(MetadataFixerResultImpl.Builder resultBu
isMissingPart = this.metadata.getPDFAIdentificationPart() == null;
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification fields.", e);
LOGGER.log(Level.FINE, "Can not obtain identification fields.");
}
try {
if (isBadPart) {
Expand All @@ -305,7 +305,7 @@ public void addPDFAIdentificationSchema(MetadataFixerResultImpl.Builder resultBu
this.setNeedToBeUpdated(true);
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification fields.", e);
LOGGER.log(Level.FINE, "Can not obtain identification fields.");
}
}

Expand All @@ -325,7 +325,7 @@ private void fixRevProperty(MetadataFixerResultImpl.Builder resultBuilder, PDFAF
resultBuilder.addFix(message);
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification fields.", e);
LOGGER.log(Level.FINE, "Can not obtain identification fields.");
}
}

Expand Down Expand Up @@ -358,7 +358,7 @@ private boolean isWrongPDFAIdentification(PDFAFlavour flavour) {
(part == 4 && !Objects.equals(conformance, schemaConformance)) ||
((part == 1 || part == 2 || part == 3) && (schemaConformance == null || compare(conformance, schemaConformance) > 0));
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification fields.", e);
LOGGER.log(Level.FINE, "Can not obtain identification fields.");
throw new IllegalStateException(e);
}
}
Expand All @@ -384,7 +384,7 @@ private boolean isValidPDFAIdentification() {
return false;
}
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not obtain identification fields.", e);
LOGGER.log(Level.FINE, "Can not obtain identification fields.");
throw new IllegalStateException(e);
}
}
Expand Down Expand Up @@ -449,7 +449,7 @@ public void updateMetadataStream(MetadataFixerResultImpl.Builder builder, PDFAFl
builder.addFix("Metadata stream filtered with FlateDecode");
}
} catch (IOException e) {
LOGGER.log(Level.FINE, "Problems with setting filter for stream.", e);
LOGGER.log(Level.FINE, "Problems with setting filter for stream.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private static MetadataImpl parseMetadata(PDMetadata meta, PDDocument document)
return new MetadataImpl(xmp, meta.getObject(),
document.getDocument(), false);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Problems with XMP parsing. " + e.getMessage(), e);
LOGGER.log(Level.FINE, "Problems with XMP parsing. " + e.getMessage());
}
return null;
}
Expand Down Expand Up @@ -160,7 +160,7 @@ public MetadataFixerResult saveDocumentIncremental(final MetadataFixerResultImpl
builder.status(status);
}
} catch (Exception e) {
LOGGER.log(Level.FINE, e.getMessage(), e);
LOGGER.log(Level.FINE, e.getMessage());
builder.status(FIX_ERROR).addFix("Problems with document save. " + e.getMessage());
}
return builder.build();
Expand All @@ -185,7 +185,7 @@ public int removeFiltersForAllMetadataObjects() {
stream.setFilters(new COSFilters());
res++;
} catch (IOException e) {
LOGGER.log(Level.FINE, "Error when removing filter from stream", e);
LOGGER.log(Level.FINE, "Error when removing filter from stream");
return -1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String getProducer() {
try {
return this.meta.getProducer();
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get producer.", e);
LOGGER.log(Level.FINE, "Can not get producer.");
throw new IllegalStateException(e);
}
}
Expand All @@ -53,7 +53,7 @@ public void setProducer(String producer) {
try {
this.meta.setProducer(producer);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set producer.", e);
LOGGER.log(Level.FINE, "Can not set producer.");
throw new IllegalStateException(e);
}
}
Expand All @@ -63,7 +63,7 @@ public String getKeywords() {
try {
return this.meta.getKeywords();
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get keywords.", e);
LOGGER.log(Level.FINE, "Can not get keywords.");
throw new IllegalStateException(e);
}
}
Expand All @@ -73,7 +73,7 @@ public void setKeywords(String keywords) {
try {
this.meta.setKeywords(keywords);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set keywords.", e);
LOGGER.log(Level.FINE, "Can not set keywords.");
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String getTitle() {
try {
return this.meta.getTitle();
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get title.", e);
LOGGER.log(Level.FINE, "Can not get title.");
throw new IllegalStateException(e);
}
}
Expand All @@ -56,7 +56,7 @@ public void setTitle(String title) {
try {
this.meta.setTitle(title);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set title.", e);
LOGGER.log(Level.FINE, "Can not set title.");
throw new IllegalStateException(e);
}
}
Expand All @@ -66,7 +66,7 @@ public String getSubject() {
try {
return this.meta.getDescription();
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get subject.", e);
LOGGER.log(Level.FINE, "Can not get subject.");
throw new IllegalStateException(e);
}
}
Expand All @@ -76,7 +76,7 @@ public void setSubject(String description) {
try {
this.meta.setDescription(description);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set description.", e);
LOGGER.log(Level.FINE, "Can not set description.");
throw new IllegalStateException(e);
}
}
Expand All @@ -100,7 +100,7 @@ public String getAuthor() {
}
return creators.isEmpty() ? null : creators.get(0);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get creator.", e);
LOGGER.log(Level.FINE, "Can not get creator.");
throw new IllegalStateException(e);
}
}
Expand All @@ -124,7 +124,7 @@ public void setAuthor(String creator) {
res.add(creator);
this.meta.setCreator(res);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set creator.", e);
LOGGER.log(Level.FINE, "Can not set creator.");
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public String getCreator() {
try {
return this.meta.getCreatorTool();
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get creator tool.", e);
LOGGER.log(Level.FINE, "Can not get creator tool.");
throw new IllegalStateException(e);
}
}
Expand All @@ -55,7 +55,7 @@ public void setCreator(String creatorTool) {
try {
this.meta.setCreatorTool(creatorTool);
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set creator tool.", e);
LOGGER.log(Level.FINE, "Can not set creator tool.");
throw new IllegalStateException(e);
}
}
Expand All @@ -65,7 +65,7 @@ public String getCreationDate() {
try {
return DateConverter.toXMPDateFormat(this.meta.getCreateDate());
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get creation date.", e);
LOGGER.log(Level.FINE, "Can not get creation date.");
throw new IllegalStateException(e);
}
}
Expand All @@ -75,7 +75,7 @@ public void setCreationDate(String creationDate) {
try {
this.meta.setCreateDate(DateConverter.toCalendar(creationDate));
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set creation date.", e);
LOGGER.log(Level.FINE, "Can not set creation date.");
throw new IllegalStateException(e);
}
}
Expand All @@ -85,7 +85,7 @@ public String getModificationDate() {
try {
return DateConverter.toXMPDateFormat(this.meta.getModifyDate());
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not get modification date.", e);
LOGGER.log(Level.FINE, "Can not get modification date.");
throw new IllegalStateException(e);
}
}
Expand All @@ -95,7 +95,7 @@ public void setModificationDate(String modificationDate) {
try {
this.meta.setModifyDate(DateConverter.toCalendar(modificationDate));
} catch (XMPException e) {
LOGGER.log(Level.FINE, "Can not set modification date.", e);
LOGGER.log(Level.FINE, "Can not set modification date.");
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static String toPDFDateFormat(String date) {
} catch (XMPException e) {
// This exception should not be thrown because of logic of metadata fixer should use this method only
// with arguments date obtained from DateConverter.toXMPDateFormat(Calendar) method
throw new IllegalStateException("Problems with parsing utc date", e);
throw new IllegalStateException("Problems with parsing utc date");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static GFModelParser createModelWithFlavour(InputStream toLoad, PDFAFlavo
} catch (InvalidPasswordException excep) {
throw new EncryptedPdfException("The PDF stream appears to be encrypted.", excep);
} catch (IOException e) {
throw new ModelParsingException("Couldn't parse stream", e);
throw new ModelParsingException("Couldn't parse stream");
}
}

Expand All @@ -156,7 +156,7 @@ public static GFModelParser createModelWithFlavour(File pdfFile, PDFAFlavour fla
} catch (InvalidPasswordException excep) {
throw new EncryptedPdfException("The PDF stream appears to be encrypted.", excep);
} catch (IOException e) {
throw new ModelParsingException("Couldn't parse stream", e);
throw new ModelParsingException("Couldn't parse stream");
}
}

Expand All @@ -183,7 +183,7 @@ private static List<PDFAFlavour> obtainFlavours(PDDocument document, PDFAFlavour

return flavours.isEmpty() ? getDefaultFlavours(defaultFlavour) : flavours;
} catch (XMPException | IOException e) {
logger.log(Level.FINE, e.getMessage(), e);
logger.log(Level.FINE, e.getMessage());
return getDefaultFlavours(defaultFlavour);
}
}
Expand All @@ -201,7 +201,7 @@ private static PDFAFlavour detectPDFAFlavour(VeraPDFMeta veraPDFMeta) {
}
return PDFAFlavour.byFlavourId(identificationPart + identificationConformance);
} catch (XMPException e) {
logger.log(Level.FINE, e.getMessage(), e);
logger.log(Level.FINE, e.getMessage());
return PDFAFlavour.NO_FLAVOUR;
}
}
Expand All @@ -222,7 +222,7 @@ private static PDFAFlavour detectPDFUAFlavour(VeraPDFMeta veraPDFMeta) {
Integer identificationPart = veraPDFMeta.getPDFUAIdentificationPart();
return PDFAFlavour.byFlavourId(PDFUA_PREFIX + identificationPart);
} catch (XMPException e) {
logger.log(Level.FINE, e.getMessage(), e);
logger.log(Level.FINE, e.getMessage());
return PDFAFlavour.NO_FLAVOUR;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private boolean isValidPDFA(PDFAFlavour[] flavours) {
unfilteredStream.reset();
}
} catch (VeraPDFException | IOException e) {
LOGGER.log(Level.FINE, "Exception during validation of embedded file", e);
LOGGER.log(Level.FINE, "Exception during validation of embedded file");
}
restoreSavedSCState();
return retVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public GFPKCSDataObject(COSString pkcsData) {
try {
pkcs7 = new PKCS7(pkcsData.get());
} catch (IOException | ArrayIndexOutOfBoundsException e) {
LOGGER.log(Level.FINE, "Passed PKCS7 object can't be read", e);
LOGGER.log(Level.FINE, "Passed PKCS7 object can't be read");
pkcs7 = getEmptyPKCS7();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public GFTrueTypeFontProgram(FontProgram trueTypeFont) {
}
this.trueTypeFont.parseFont();
} catch (IOException e) {
LOGGER.log(Level.FINE, "Error in parsing embedded True Type font file", e);
LOGGER.log(Level.FINE, "Error in parsing embedded True Type font file");
}
}

Expand Down
Loading
Loading