Author: jeremias
Date: Mon Jan 17 15:08:39 2011
New Revision: 1059945

URL: http://svn.apache.org/viewvc?rev=1059945&view=rev
Log:
Bugfix: Extracting the base directory through Configuration.getLocation() 
didn't work for Windows, since Windows paths can contain drive letters that are 
separated by colons. This lead to FOP scanning the whole drive for fonts 
starting from the drive root in the auto-detect case.

Modified:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FopFactoryConfigurator.java

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FopFactoryConfigurator.java?rev=1059945&r1=1059944&r2=1059945&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FopFactoryConfigurator.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FopFactoryConfigurator.java 
Mon Jan 17 15:08:39 2011
@@ -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();



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to