* @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();
}
}
if (getLogger().isDebugEnabled()) {
try {
StringBuilder buf = new StringBuilder(1000);
InputStream debugIn = Util.readVirtualFile(catalogUrl);
int n;
while ((n = debugIn.read()) != -1) {
buf.append((char) n);
}
getLogger().debug(
"RolapSchema.load: content: \n" + buf.toString());
} catch (java.io.IOException ex) {
getLogger().debug("RolapSchema.load: ex=" + ex);
}
}
} else {
if (getLogger().isDebugEnabled()) {
getLogger().debug(
"RolapSchema.load: catalogStr: \n" + catalogStr);
}
def = xmlParser.parse(catalogStr);
}
xmlSchema = new MondrianDef.Schema(def);
if (getLogger().isDebugEnabled()) {