* Read the servlets.properties file
* @param file the servlets.properties file.
*/
protected void readProperties(File file) {
Properties props = new Properties();
servlets = new LookupTable();
general = new LookupTable();
try {
InputStream in =
new BufferedInputStream(new FileInputStream(file));
props.load(in);
in.close();
} catch (FileNotFoundException fnfex) {
// nothing
} catch (IOException ioex) {
// nothing to do
}
Enumeration e = props.propertyNames();
while (e.hasMoreElements()) {
String property = (String) e.nextElement();
if (property.startsWith("servlet.")) {
String value = props.getProperty(property);
property = property.substring(8); // remove "servlet."
int idx = property.indexOf('.');
if (idx != -1) {
String name = property.substring(0, idx);
property = property.substring(idx+1);
if (idx != -1) {
LookupTable lt = (LookupTable) servlets.get(name);
if (lt == null) {
lt = new LookupTable();
servlets.put(name, lt);
}
lt.put(property, value);
}
}
} else if (property.startsWith("servlets.")) {
String value = props.getProperty(property);
String name = property.substring(9); // remove "servlets."