You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/12/10 21:01:52 UTC
svn commit: r889398 - in /cxf/branches/2.1.x-fixes: ./
tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Author: dkulp
Date: Thu Dec 10 20:01:51 2009
New Revision: 889398
URL: http://svn.apache.org/viewvc?rev=889398&view=rev
Log:
Merged revisions 889394 via svnmerge from
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................
r889394 | dkulp | 2009-12-10 14:56:16 -0500 (Thu, 10 Dec 2009) | 9 lines
Merged revisions 889387 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r889387 | dkulp | 2009-12-10 14:48:12 -0500 (Thu, 10 Dec 2009) | 1 line
[CXF-2376] Add "classpath:" url support for wsdl2java things
........
................
Modified:
cxf/branches/2.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?rev=889398&r1=889397&r2=889398&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java (original)
+++ cxf/branches/2.1.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java Thu Dec 10 20:01:51 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",
@@ -222,6 +224,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();