}
public static PortalConfig create(File xml, File dir)
throws ConfigurationException {
if (!dir.isDirectory()) {
throw new ConfigurationException(
"directory " + dir + " does not exist");
}
if (!xml.isFile()) {
throw new ConfigurationException(
"configuration file " + xml + " does not exist");
}
try {
return create(new FileInputStream(xml), dir.getPath());
} catch(FileNotFoundException ex) {
throw new ConfigurationException("File " + xml +
" cannot be found. ", ex);
}
}