Author: klape
Date: 2014-02-12 18:55:06 -0500 (Wed, 12 Feb 2014)
New Revision: 18350
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/validation/SchemaExtractor.java
Log:
[JBPAPP-10869] Unable to load schema with @SchemaValidation when wsdl filename has
non-alphabetic chars
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/validation/SchemaExtractor.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/validation/SchemaExtractor.java 2014-02-12
16:56:11 UTC (rev 18349)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/validation/SchemaExtractor.java 2014-02-12
23:55:06 UTC (rev 18350)
@@ -26,6 +26,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.File;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.util.ArrayList;
@@ -75,11 +76,11 @@
}
public Map<String, byte[]> getSchemas(URL wsdlURL) throws IOException
{
- Map<String, byte[]> streams = new HashMap<String, byte[]>();
+ Map<String, byte[]> streams = new HashMap<String, byte[]>();
//Get the path to the WSDL
- Pattern p = Pattern.compile("[a-zA-Z]+\\.[a-zA-Z]+$");
- Matcher m = p.matcher(wsdlURL.getFile());
- path = m.replaceFirst("");
+ String wsdlFile = wsdlURL.getFile();
+ int lastSlash = wsdlFile.lastIndexOf(File.separator);
+ path = wsdlFile.substring(0, lastSlash+1);
// parse the wsdl
Element root = DOMUtils.parse(wsdlURL.openStream());
Show replies by date