]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Ported the latest bugfix in FOUserAgent to branch:
authorJeremias Maerki <jeremias@apache.org>
Wed, 1 Mar 2006 10:41:04 +0000 (10:41 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 1 Mar 2006 10:41:04 +0000 (10:41 +0000)
Fix bug in the construction of a base URL when it's specified as a file system path.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_API_Finalization@381982 13f79535-47bb-0310-9956-ffa450edef68

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

index 75d2902b98b892b99b4431a755f4a85dea06a920..ef895d26bdcbfc66356d16f6fe0f68235aeed6e1 100644 (file)
@@ -459,10 +459,7 @@ public class FopFactory {
                 if (cfgBaseDir != null) {
                     File dir = new File(cfgBaseDir);
                     if (dir.isDirectory()) {
-                        cfgBaseDir = "file://" + dir.getCanonicalPath() 
-                            + System.getProperty("file.separator");
-                        cfgBaseDir = cfgBaseDir.replace(
-                                System.getProperty("file.separator").charAt(0), '/');
+                        cfgBaseDir = dir.toURL().toExternalForm(); 
                     } else {
                         //The next statement is for validation only
                         new URL(cfgBaseDir);