]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix: Extracting the base directory through Configuration.getLocation() didn't...
authorJeremias Maerki <jeremias@apache.org>
Mon, 17 Jan 2011 15:08:39 +0000 (15:08 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 17 Jan 2011 15:08:39 +0000 (15:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1059945 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/apps/FopFactoryConfigurator.java

index 6c1986cb21d5919e32eb17f56bea5a03b16af03d..9de00cd8540ee075065313c5096ada191e3e2814 100644 (file)
@@ -377,11 +377,17 @@ public class FopFactoryConfigurator {
     }
 
     private void setBaseURI() throws FOPException {
-        String[] locationParts = cfg.getLocation().split(":");
+        String loc = cfg.getLocation();
+        String[] locationParts = (loc != null ? cfg.getLocation().split(":") : null);
         try {
             if (locationParts != null && locationParts.length >= 2
                     && "file".equals(locationParts[0])) {
-                baseURI = new URI(locationParts[0], locationParts[1], null);
+                StringBuilder sb = new StringBuilder(locationParts[1]);
+                for (int idx = 2; idx < locationParts.length; idx++) {
+                    sb.append(":").append(locationParts[idx]);
+                }
+                baseURI = new URI(locationParts[0], sb.toString(), null);
+                baseURI = baseURI.resolve(".").normalize();
             }
             if (baseURI == null) {
                 baseURI = new File(System.getProperty("user.dir")).toURI();