diff --git a/.gitignore b/.gitignore index 4c1a033..99ae847 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,7 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* .idea/ +.classpath +.project +.settings/ +/target/ diff --git a/src/main/java/org/wso2/soaptorest/WSDLProcessor.java b/src/main/java/org/wso2/soaptorest/WSDLProcessor.java index 84a45ef..97c6623 100644 --- a/src/main/java/org/wso2/soaptorest/WSDLProcessor.java +++ b/src/main/java/org/wso2/soaptorest/WSDLProcessor.java @@ -81,9 +81,10 @@ void init(String path) throws SOAPToRESTException { wsdlReader.setFeature(JAVAX_WSDL_VERBOSE_MODE, false); wsdlReader.setFeature(JAVAX_WSDL_IMPORT_DOCUMENTS, false); try { - String systemId = ""; - if (path.lastIndexOf(File.separator) > 0) { - systemId = path.substring(0, path.lastIndexOf(File.separator)); + File file = new File(path); + String systemId = file.getParent(); + if (systemId == null) { + systemId = ""; } wsdlDefinition = wsdlReader.readWSDL(systemId, WSDLProcessingUtil.getSecuredParsedDocumentFromPath(path, systemId)); initializeModels(wsdlDefinition, systemId);