geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1347923 - /geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleUtils.java
Date Fri, 08 Jun 2012 07:59:23 GMT
Author: xiaming
Date: Fri Jun  8 07:59:23 2012
New Revision: 1347923

URL: http://svn.apache.org/viewvc?rev=1347923&view=rev
Log:
GERONIMO-6358 A better fix for similar file system path string issue, provided by Saphen Qiu

Modified:
    geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleUtils.java

Modified: geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleUtils.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleUtils.java?rev=1347923&r1=1347922&r2=1347923&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleUtils.java
(original)
+++ geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleUtils.java
Fri Jun  8 07:59:23 2012
@@ -272,9 +272,13 @@ public class BundleUtils {
      */
     public static File toFile(String url) {
         if (url !=null && url.startsWith(REFERENCE_FILE_SCHEMA)) {
-            File file = new File(url.substring(REFERENCE_FILE_SCHEMA.length()).replaceAll("%20",
" "));
-            if (file.exists()) {
-                return file;
+            try {
+                File file = new File(new URL(url.substring(REFERENCE_SCHEME.length())).toURI());
+                if (file.exists()) {
+                    return file;
+                }
+            } catch (Exception e) {
+                // TODO: handle exception
             }
         }
         return null;



Mime
View raw message