svn commit: r505358 - in /ofbiz/trunk/framework: base/src/base/org/ofbiz/base/container/ base/src/base/org/ofbiz/base/util/ base/src/start/org/ofbiz/base/start/ entity/src/org/ofbiz/entity/util/ entityext/src/org/ofbiz/entityext/data/ webtools/src/org/...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r505358 - in /ofbiz/trunk/framework: base/src/base/org/ofbiz/base/container/ base/src/base/org/ofbiz/base/util/ base/src/start/org/ofbiz/base/start/ entity/src/org/ofbiz/entity/util/ entityext/src/org/ofbiz/entityext/data/ webtools/src/org/...

jonesde
Author: jonesde
Date: Fri Feb  9 08:37:05 2007
New Revision: 505358

URL: http://svn.apache.org/viewvc?view=rev&rev=505358
Log:
Changed a number of places to use File.toURI().toURL() instead of just File.toURL(); thanks to Andras Robert for his research and comments on this; looking at the Java API docs it looks like this basically just escaped the characters in the eventual URL

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/container/ComponentContainer.java
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilURL.java
    ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java
    ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/container/ComponentContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/container/ComponentContainer.java?view=diff&rev=505358&r1=505357&r2=505358
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/container/ComponentContainer.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/container/ComponentContainer.java Fri Feb  9 08:37:05 2007
@@ -151,7 +151,7 @@
             if (componentLoadConfig != null && componentLoadConfig.exists()) {
                 URL configUrl = null;
                 try {
-                    configUrl = componentLoadConfig.toURL();
+                    configUrl = componentLoadConfig.toURI().toURL();
                     List componentsToLoad = ComponentLoaderConfig.getComponentsFromConfig(configUrl);
                     if (componentsToLoad != null) {
                         Iterator i = componentsToLoad.iterator();

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilURL.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilURL.java?view=diff&rev=505358&r1=505357&r2=505358
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilURL.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilURL.java Fri Feb  9 08:37:05 2007
@@ -86,7 +86,7 @@
         URL url = null;
 
         try {
-            if (file.exists()) url = file.toURL();
+            if (file.exists()) url = file.toURI().toURL();
         } catch (java.net.MalformedURLException e) {
             e.printStackTrace();
             url = null;

Modified: ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java?view=diff&rev=505358&r1=505357&r2=505358
==============================================================================
--- ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java (original)
+++ ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java Fri Feb  9 08:37:05 2007
@@ -117,8 +117,12 @@
         URL[] urls = new URL[cnt];
         for (int i = 0; i < cnt; i++) {
             try {
-                urls[i] = ((File) (_elements.get(i))).toURL();
-            } catch (MalformedURLException e) {}
+                urls[i] = ((File) (_elements.get(i))).toURI().toURL();
+            } catch (MalformedURLException e) {
+                // note: this is printing right to the console because at this point we don't have the rest of the system up, not even the logging stuff
+                System.out.println("Error adding classpath entry: " + e.toString());
+                e.printStackTrace();
+            }
         }
         return urls;
     }

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java?view=diff&rev=505358&r1=505357&r2=505358
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataLoader.java Fri Feb  9 08:37:05 2007
@@ -158,7 +158,7 @@
                         if (dataFile.exists()) {
                             URL url = null;
                             try {
-                                url = dataFile.toURL();
+                                url = dataFile.toURI().toURL();
                                 urlList.add(url);
                             } catch (java.net.MalformedURLException e) {
                                 String xmlError = "Error loading XML file \"" + dataFile.getAbsolutePath() + "\"; Error was: " + e.getMessage();

Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java?view=diff&rev=505358&r1=505357&r2=505358
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java Fri Feb  9 08:37:05 2007
@@ -210,7 +210,7 @@
                     for (int i = 0; i < fileArray.length; i++) {
                         if (fileArray[i].getName().toLowerCase().endsWith(".xml")) {
                             try {
-                                urlList.add(fileArray[i].toURL());
+                                urlList.add(fileArray[i].toURI().toURL());
                             } catch (MalformedURLException e) {
                                 Debug.logError(e, "Unable to load file (" + fileArray[i].getName() + "); not a valid URL.", module);
                             }

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?view=diff&rev=505358&r1=505357&r2=505358
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Fri Feb  9 08:37:05 2007
@@ -241,7 +241,7 @@
                     }
                     File curFile = (File)files.get(a);
                     try{
-                        URL url = curFile.toURL();
+                        URL url = curFile.toURI().toURL();
                         Map inputMap = UtilMisc.toMap("url", url,
                                                       "mostlyInserts", mostlyInserts,
                                                       "createDummyFks", createDummyFks,