in src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java [370:411]
public void loadSystemCatalogs() throws IOException {
fs = ((CatalogManager) catalogManager).getFileSystem();
final String base = ((CatalogManager) catalogManager).getBaseDir();
// This is safe because the catalog manager returns a vector of strings.
final Vector<String> catalogs = catalogManager.getCatalogFiles();
if (catalogs != null) {
for (int count = 0; count < catalogs.size(); count++) {
final String fileName = catalogs.elementAt(count);
URL url = null;
InputStream inputStream = null;
try {
url = locate(fs, base, fileName);
if (url != null) {
inputStream = fs.getInputStream(url);
}
} catch (final ConfigurationException ce) {
final String name = url.toString();
// Ignore the exception.
catalogManager.debug.message(DEBUG_ALL, "Unable to get input stream for " + name + ". " + ce.getMessage());
}
if (inputStream != null) {
final String mimeType = fileNameMap.getContentTypeFor(fileName);
try {
if (mimeType != null) {
parseCatalog(mimeType, inputStream);
continue;
}
} catch (final Exception ex) {
// Ignore the exception.
catalogManager.debug.message(DEBUG_ALL, "Exception caught parsing input stream for " + fileName + ". " + ex.getMessage());
} finally {
inputStream.close();
}
}
parseCatalog(base, fileName);
}
}
}