String locator = getWsdlFile().getLocator();
downloader.download(locator);
}
private void parse(byte[] contents) {
WsdlParser parser = WsdlParserFactory.newParser(getWsdlFile(), fileStore);
try {
setNewMessage(PackageResources.ProcessExistingFileJob.STATUS_PARSING);
WebServiceInfo info = parser.parse(contents);
setParsedInfo(info);
signalJobSucceeded();
parser.dispose();
} catch (WsdlParserException e) {
signalJobFailed(e);
} finally {
// We dispose() the parser above, if the parsing succeeds. In release mode we want to make
// sure the parser is disposed (e.g. temp files are removed) if an error occurs. In debug mode
// we leave the files were they are, so that we can look at them.
// Note that the duplicate call to dispose() that takes place in release mode on success is ok,
// since the second call is a no-op (see contract of WsdlParser.dispose()).
if (!DebugMode.IS_ENABLED) {
parser.dispose();
}
}
}