Skip to content

Commit 4c3e386

Browse files
author
Kate Ivanova
committed
Update printed links in CompareTool
DEVSIX-4780
1 parent 609079c commit 4c3e386

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

kernel/src/main/java/com/itextpdf/kernel/utils/CompareTool.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ This file is part of the iText (R) project.
126126
* for the content of the cmpDoc and "but was" part stands for the content of the outDoc.
127127
*/
128128
public class CompareTool {
129+
private static final String FILE_PROTOCOL = "file://";
129130
private static final String UNEXPECTED_NUMBER_OF_PAGES = "Unexpected number of pages for <filename>.";
130-
private static final String DIFFERENT_PAGES = "File file:///<filename> differs on page <pagenumber>.";
131+
private static final String DIFFERENT_PAGES = "File " + FILE_PROTOCOL + "<filename> differs on page <pagenumber>.";
131132
private static final String IGNORED_AREAS_PREFIX = "ignored_areas_";
132133

133134
private static final String VERSION_REGEXP = "(iText\u00ae( pdfX(FA|fa)| DITO)?|iTextSharp\u2122) (\\d+\\.)+\\d+(-SNAPSHOT)?";
@@ -1057,7 +1058,8 @@ private String compareImagesOfPdfs(String outPath, String differenceImagePrefix,
10571058
if (!imageMagickHelper.runImageMagickImageCompare(imageFiles[i].getAbsolutePath(),
10581059
cmpImageFiles[i].getAbsolutePath(), diffName)) {
10591060
File diffFile = new File(diffName);
1060-
differentPagesFail += "\nPlease, examine " + "file:///" + UrlUtil.toNormalizedURI(diffFile).getPath() + " for more details.";
1061+
differentPagesFail += "\nPlease, examine " + FILE_PROTOCOL
1062+
+ UrlUtil.toNormalizedURI(diffFile).getPath() + " for more details.";
10611063
}
10621064
}
10631065
System.out.println(differentPagesFail);
@@ -1150,8 +1152,10 @@ private void prepareOutputDirs(String outPath, String differenceImagePrefix) {
11501152
}
11511153

11521154
private void printOutCmpDirectories() {
1153-
System.out.println("Out file folder: file://" + UrlUtil.toNormalizedURI(new File(outPdf).getParentFile()).getPath());
1154-
System.out.println("Cmp file folder: file://" + UrlUtil.toNormalizedURI(new File(cmpPdf).getParentFile()).getPath());
1155+
System.out.println("Out file folder: " + FILE_PROTOCOL
1156+
+ UrlUtil.toNormalizedURI(new File(outPdf).getParentFile()).getPath());
1157+
System.out.println("Cmp file folder: " + FILE_PROTOCOL
1158+
+ UrlUtil.toNormalizedURI(new File(cmpPdf).getParentFile()).getPath());
11551159
}
11561160

11571161
private String compareByContent(String outPath, String differenceImagePrefix, Map<Integer, List<Rectangle>> ignoredAreas) throws InterruptedException, IOException {

0 commit comments

Comments
 (0)