Author: dkulp
Date: Thu Dec 10 19:56:16 2009
New Revision: 889394
URL: http://svn.apache.org/viewvc?rev=889394&view=rev
Log:
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.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?rev=889394&r1=889393&r2=889394&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
(original)
+++
cxf/branches/2.2.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
Thu Dec 10 19:56:16 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();