if (LogSupport.isLoggable())
LogSupport.log("MimetypesFileTypeMap: URL " + url);
try {
clis = SecuritySupport.openStream(url);
if (clis != null) {
v.addElement(new MimeTypeFile(clis));
anyLoaded = true;
if (LogSupport.isLoggable())
LogSupport.log("MimetypesFileTypeMap: " +
"successfully loaded " +
"mime types from URL: " + url);
} else {
if (LogSupport.isLoggable())
LogSupport.log("MimetypesFileTypeMap: " +
"not loading " +
"mime types from URL: " + url);
}
} catch (IOException ioex) {
if (LogSupport.isLoggable())
LogSupport.log("MimetypesFileTypeMap: can't load " +
url, ioex);
} catch (SecurityException sex) {
if (LogSupport.isLoggable())
LogSupport.log("MimetypesFileTypeMap: can't load " +
url, sex);
} finally {
try {
if (clis != null)
clis.close();
} catch (IOException cex) { }
}
}
}
} catch (Exception ex) {
if (LogSupport.isLoggable())
LogSupport.log("MimetypesFileTypeMap: can't load " + name, ex);
}
// if failed to load anything, fall back to old technique, just in case
if (!anyLoaded) {
LogSupport.log("MimetypesFileTypeMap: !anyLoaded");
MimeTypeFile mf = loadResource("/" + name);
if (mf != null)
v.addElement(mf);
}
}