try {
input = url.openStream();
}
catch (IOException e) {
throw new AWGenericException(Fmt.S("Cannot Open URL %s, error: %s",
url.toString(), e.getMessage()));
}
try {
/* create input source */
String urlString = url.toString();
InputSource inputSource = new InputSource(input);
/* turn on for debug */
/* Log.startupUtil.debug("Reading URL: " + urlString); */
inputSource.setSystemId(urlString);
/* parse document */
doc = document(inputSource, validate,
removeWhitespace, resolver);
}
finally {
try {
/* close input stream */
input.close();
}
catch (IOException e) {
throw new AWGenericException(
Fmt.S("Cannot Open URL %s, error: %s",
url.toString(), e.getMessage()));
}
}