svn commit: r477801 - /incubator/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java

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

svn commit: r477801 - /incubator/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java

jonesde
Author: jonesde
Date: Tue Nov 21 10:24:27 2006
New Revision: 477801

URL: http://svn.apache.org/viewvc?view=rev&rev=477801
Log:
Applied reformatted patch from Jacques based on patch from Stephen Parry to escape spaces in classpath entries, which should resolve problem with jdk location on Windows; Jira #OFBIZ-486

Modified:
    incubator/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java

Modified: incubator/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java?view=diff&rev=477801&r1=477800&r2=477801
==============================================================================
--- incubator/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java (original)
+++ incubator/ofbiz/trunk/framework/base/src/start/org/ofbiz/base/start/Classpath.java Tue Nov 21 10:24:27 2006
@@ -82,15 +82,29 @@
         return added;
     }
 
+    
+    private void appendPath(StringBuffer cp, String path) {
+        if(path.indexOf(' ') >= 0) {
+            cp.append('\"');
+            cp.append(path);
+            cp.append('"');
+        }
+        else {
+            cp.append(path);
+        }
+     }
+    
+    
     public String toString() {
         StringBuffer cp = new StringBuffer(1024);
         int cnt = _elements.size();
         if (cnt >= 1) {
             cp.append(((File) (_elements.get(0))).getPath());
+            appendPath(cp, ((File) (_elements.get(0))).getPath());
         }
         for (int i = 1; i < cnt; i++) {
             cp.append(File.pathSeparatorChar);
-            cp.append(((File) (_elements.get(i))).getPath());
+            appendPath(cp, ((File) (_elements.get(0))).getPath());
         }
         return cp.toString();
     }