cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r635780 - /incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Date Tue, 11 Mar 2008 02:38:12 GMT
Author: dkulp
Date: Mon Mar 10 19:38:09 2008
New Revision: 635780

URL: http://svn.apache.org/viewvc?rev=635780&view=rev
Log:
[CXF-1465] Update URI parsing stuff to use the File object to help

Modified:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?rev=635780&r1=635779&r2=635780&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Mon Mar 10 19:38:09 2008
@@ -222,16 +222,19 @@
             return url.toString().replace("\\", "/");
         } catch (MalformedURLException e1) {
             try {
+                File file = new File(uri);
+                if (file.exists()) {
+                    return file.toURI().normalize().toString();
+                }
                 String f = null;
                 if (uri.indexOf(":") != -1 && !uri.startsWith("/")) {
                     f = "file:/" + uri;
                 } else {
                     f = "file:" + uri;
                 }
-
                 url = new URL(f);
                 return url.toString().replace("\\", "/");
-            } catch (MalformedURLException e2) {
+            } catch (Exception e2) {
                 return uri.replace("\\", "/");
             }
         }



Mime
View raw message