pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1848579 - in /pdfbox/trunk: 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/pdfbox/pdm...
Date Mon, 10 Dec 2018 13:37:58 GMT
Author: tilman
Date: Mon Dec 10 13:37:57 2018
New Revision: 1848579

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

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

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java
(original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/tooltip/KToolTip.java
Mon Dec 10 13:37:57 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/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java Mon Dec
10 13:37:57 2018
@@ -219,8 +219,8 @@ public final class OpenTypeScript
 
     static
     {
-        String path = "org/apache/fontbox/unicode/Scripts.txt";
-        try (InputStream input = OpenTypeScript.class.getClassLoader().getResourceAsStream(path))
+        String path = "/org/apache/fontbox/unicode/Scripts.txt";
+        try (InputStream input = OpenTypeScript.class.getResourceAsStream(path))
         {
             if (input != null)
             {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java Mon
Dec 10 13:37:57 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/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/Standard14Fonts.java
Mon Dec 10 13:37:57 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)
         {
             try (InputStream afmStream = url.openStream())

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java
Mon Dec 10 13:37:57 2018
@@ -46,11 +46,10 @@ public final class GlyphList
      */
     private static GlyphList load(String filename, int numberOfEntries)
     {
-        ClassLoader loader = GlyphList.class.getClassLoader();
-        String path = "org/apache/pdfbox/resources/glyphlist/";
+        String path = "/org/apache/pdfbox/resources/glyphlist/";
         try
         {
-            return new GlyphList(loader.getResourceAsStream(path + filename), numberOfEntries);
+            return new GlyphList(GlyphList.class.getResourceAsStream(path + filename), numberOfEntries);
         }
         catch (IOException e)
         {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceCMYK.java
Mon Dec 10 13:37:57 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/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/LegacyPDFStreamEngine.java Mon
Dec 10 13:37:57 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";
-        try (InputStream input = GlyphList.class.getClassLoader().getResourceAsStream(path))
+        String path = "/org/apache/pdfbox/resources/glyphlist/additional.txt";
+        try (InputStream input = GlyphList.class.getResourceAsStream(path))
         {
             glyphList = new GlyphList(GlyphList.getAdobeGlyphList(), input);
         }

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Version.java Mon Dec 10 13:37:57
2018
@@ -32,7 +32,7 @@ public final class Version
     private static final Log LOG = LogFactory.getLog(Version.class);
 
     private static final String PDFBOX_VERSION_PROPERTIES =
-            "org/apache/pdfbox/resources/version.properties";
+            "/org/apache/pdfbox/resources/version.properties";
 
     private Version()
     {
@@ -46,7 +46,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/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java Mon Dec
10 13:37:57 2018
@@ -120,8 +120,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());
 
         try (TrueTypeFont ttf1 = new TTFParser().parse(fontFile))

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java
Mon Dec 10 13:37:57 2018
@@ -272,8 +272,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);
             try (PDPageContentStream stream = new PDPageContentStream(document, page))
             {

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java?rev=1848579&r1=1848578&r2=1848579&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java Mon
Dec 10 13:37:57 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