* @param catalogUrl URL of catalog
* @param catalogStr Text of catalog, or null
*/
protected void load(String catalogUrl, String catalogStr) {
try {
final Parser xmlParser = XOMUtil.createDefaultParser();
final DOMWrapper def;
if (catalogStr == null) {
InputStream in = null;
try {
in = Util.readVirtualFile(catalogUrl);
def = xmlParser.parse(in);
} finally {
if (in != null) {
in.close();
}
}
// Compute catalog string, if needed for debug or for computing
// Md5 hash.
if (getLogger().isDebugEnabled() || md5Bytes == null) {
try {
catalogStr = Util.readVirtualFileAsString(catalogUrl);
} catch (java.io.IOException ex) {
getLogger().debug("RolapSchema.load: ex=" + ex);
catalogStr = "?";
}
}
if (getLogger().isDebugEnabled()) {
getLogger().debug(
"RolapSchema.load: content: \n" + catalogStr);
}
} else {
if (getLogger().isDebugEnabled()) {
getLogger().debug(
"RolapSchema.load: catalogStr: \n" + catalogStr);
}
def = xmlParser.parse(catalogStr);
}
if (md5Bytes == null) {
// If a null catalogStr was passed in, we should have
// computed it above by re-reading the catalog URL.