pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1848574 - in /pdfbox/branches/2.0: debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/ fontbox/src/main/java/org/apache/fontbox/ttf/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ pdfbox/src/main/java/org/apache/pdf...
Date Mon, 10 Dec 2018 13:12:23 GMT
Author: tilman
Date: Mon Dec 10 13:12:22 2018
New Revision: 1848574

URL: http://svn.apache.org/viewvc?rev=1848574&view=rev
Log:
PDFBOX-4400: don't use getClassLoader() to get resources because of problems with jlink

Modified:
    pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java
    pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java
    pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
    pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
    pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java

Modified: pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java
(original)
+++ pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java
Mon Dec 10 13:12:22 2018
@@ -77,9 +77,9 @@ final class KToolTip extends ColorToolTi
         // Instead, the "ISO Coated v2 300% (basICColor)" is used, which
         // is an open alternative to the "ISO Coated v2 300% (ECI)" profile.
 
-        String name = "org/apache/pdfbox/resources/icc/ISOcoated_v2_300_bas.icc";
+        String name = "/org/apache/pdfbox/resources/icc/ISOcoated_v2_300_bas.icc";
 
-        URL url = PDDeviceCMYK.class.getClassLoader().getResource(name);
+        URL url = PDDeviceCMYK.class.getResource(name);
         if (url == null)
         {
             throw new IOException("Error loading resource: " + name);

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java Mon
Dec 10 13:12:22 2018
@@ -218,11 +218,11 @@ public final class OpenTypeScript
 
     static
     {
-        String path = "org/apache/fontbox/unicode/Scripts.txt";
+        String path = "/org/apache/fontbox/unicode/Scripts.txt";
         InputStream input = null;
         try
         {
-            input = OpenTypeScript.class.getClassLoader().getResourceAsStream(path);
+            input = OpenTypeScript.class.getResourceAsStream(path);
             if (input != null)
             {
                 parseScriptsFile(input);

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
Mon Dec 10 13:12:22 2018
@@ -108,8 +108,8 @@ final class FontMapperImpl implements Fo
         
         try
         {
-            String ttfName = "org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf";
-            URL url = FontMapper.class.getClassLoader().getResource(ttfName);
+            String ttfName = "/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf";
+            URL url = FontMapper.class.getResource(ttfName);
             if (url == null)
             {
                 throw new IOException("Error loading resource: " + ttfName);

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
Mon Dec 10 13:12:22 2018
@@ -113,8 +113,8 @@ final class Standard14Fonts
             STANDARD14_AFM_MAP.put(fontName, STANDARD14_AFM_MAP.get(afmName));
         }
 
-        String resourceName = "org/apache/pdfbox/resources/afm/" + afmName + ".afm";
-        URL url = PDType1Font.class.getClassLoader().getResource(resourceName);
+        String resourceName = "/org/apache/pdfbox/resources/afm/" + afmName + ".afm";
+        URL url = PDType1Font.class.getResource(resourceName);
         if (url != null)
         {
             InputStream afmStream = url.openStream();

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java
Mon Dec 10 13:12:22 2018
@@ -95,9 +95,9 @@ public class PDDeviceCMYK extends PDDevi
         // Instead, the "ISO Coated v2 300% (basICColor)" is used, which
         // is an open alternative to the "ISO Coated v2 300% (ECI)" profile.
 
-        String name = "org/apache/pdfbox/resources/icc/ISOcoated_v2_300_bas.icc";
+        String name = "/org/apache/pdfbox/resources/icc/ISOcoated_v2_300_bas.icc";
 
-        URL url = PDDeviceCMYK.class.getClassLoader().getResource(name);
+        URL url = PDDeviceCMYK.class.getResource(name);
         if (url == null)
         {
             throw new IOException("Error loading resource: " + name);

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
Mon Dec 10 13:12:22 2018
@@ -110,8 +110,8 @@ class LegacyPDFStreamEngine extends PDFS
         addOperator(new ShowTextLineAndSpace());
 
         // load additional glyph list for Unicode mapping
-        String path = "org/apache/pdfbox/resources/glyphlist/additional.txt";
-        InputStream input = GlyphList.class.getClassLoader().getResourceAsStream(path);
+        String path = "/org/apache/pdfbox/resources/glyphlist/additional.txt";
+        InputStream input = GlyphList.class.getResourceAsStream(path);
         glyphList = new GlyphList(GlyphList.getAdobeGlyphList(), input);
     }
 

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java Mon
Dec 10 13:12:22 2018
@@ -1839,8 +1839,8 @@ public class PDFTextStripper extends Leg
 
     static
     {
-        String path = "org/apache/pdfbox/resources/text/BidiMirroring.txt";
-        InputStream input = PDFTextStripper.class.getClassLoader().getResourceAsStream(path);
+        String path = "/org/apache/pdfbox/resources/text/BidiMirroring.txt";
+        InputStream input = PDFTextStripper.class.getResourceAsStream(path);
         try
         {
             if (input != null)

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java Mon Dec 10
13:12:22 2018
@@ -27,7 +27,7 @@ import java.util.Properties;
 public final class Version
 {
     private static final String PDFBOX_VERSION_PROPERTIES =
-            "org/apache/pdfbox/resources/version.properties";
+            "/org/apache/pdfbox/resources/version.properties";
 
     private Version()
     {
@@ -41,7 +41,7 @@ public final class Version
     {
         try
         {
-            URL url = Version.class.getClassLoader().getResource(PDFBOX_VERSION_PROPERTIES);
+            URL url = Version.class.getResource(PDFBOX_VERSION_PROPERTIES);
             if (url == null)
             {
                 return null;

Modified: pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
Mon Dec 10 13:12:22 2018
@@ -127,8 +127,8 @@ public class PDFontTest
     @Test
     public void testPDFBox3826() throws IOException, URISyntaxException
     {
-        URL url = PDFont.class.getClassLoader().getResource(
-                "org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf");
+        URL url = PDFont.class.getResource(
+                "/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf");
         File fontFile = new File(url.toURI());
 
         TrueTypeFont ttf1 = new TTFParser().parse(fontFile);

Modified: pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
Mon Dec 10 13:12:22 2018
@@ -220,8 +220,8 @@ public class TestFontEmbedding extends T
         PDPage page = new PDPage(PDRectangle.A4);
         document.addPage(page);
 
-        InputStream input = PDFont.class.getClassLoader().getResourceAsStream(
-                "org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf");
+        InputStream input = PDFont.class.getResourceAsStream(
+                "/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf");
         PDType0Font font = PDType0Font.load(document, input, useSubset);
 
         PDPageContentStream stream = new PDPageContentStream(document, page);

Modified: pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java?rev=1848574&r1=1848573&r2=1848574&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
Mon Dec 10 13:12:22 2018
@@ -41,8 +41,8 @@ public class TestTTFParser
     @Test
     public void testPostTable() throws IOException
     {
-        InputStream input = PDFont.class.getClassLoader().getResourceAsStream(
-                "org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf");
+        InputStream input = PDFont.class.getResourceAsStream(
+                "/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf");
         Assert.assertNotNull(input);
 
         TTFParser parser = new TTFParser();



Mime
View raw message