cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r889387 - /cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Date Thu, 10 Dec 2009 19:48:12 GMT
Author: dkulp
Date: Thu Dec 10 19:48:12 2009
New Revision: 889387

URL: http://svn.apache.org/viewvc?rev=889387&view=rev
Log:
[CXF-2376] Add "classpath:" url support for wsdl2java things

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

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?rev=889387&r1=889386&r2=889387&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java Thu
Dec 10 19:48:12 2009
@@ -30,6 +30,8 @@
 import java.util.Set;
 import java.util.StringTokenizer;
 
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+
 public final class URIParserUtil {
     private static final Set<String> KEYWORDS = new HashSet<String>(Arrays
         .asList(new String[] {"abstract", "boolean", "break", "byte", "case", "catch", "char",
"class",
@@ -223,6 +225,14 @@
             return url.toString().replace("\\", "/");
         } catch (MalformedURLException e1) {
             try {
+                if (uri.startsWith("classpath:")) {
+                    
+                    url = ClassLoaderUtils.getResource(uri.substring(10), URIParserUtil.class);
+                    if (url != null) {
+                        return url.toExternalForm();
+                    }
+                    return uri;
+                }
                 File file = new File(uri);
                 if (file.exists()) {
                     return file.toURI().normalize().toString();



Mime
View raw message