} finally {
}
}
public ConfigBean read() throws OKMException {
ConfigBean configBean = new ConfigBean();
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse (new File(configFilename));
NodeList nodes = doc.getElementsByTagName("openkm");
if (nodes.getLength()>0) {
Node config = nodes.item(0);
Element configElement = (Element) config;
if (configElement.getElementsByTagName("host").item(0).hasChildNodes()) {
configBean.setHost(configElement.getElementsByTagName("host").item(0).getChildNodes().item(0).getNodeValue());
}
if (configElement.getElementsByTagName("user").item(0).hasChildNodes()) {
configBean.setUser(configElement.getElementsByTagName("user").item(0).getChildNodes().item(0).getNodeValue());
}
if (configElement.getElementsByTagName("password").item(0).hasChildNodes()) {
configBean.setPassword(configElement.getElementsByTagName("password").item(0).getChildNodes().item(0).getNodeValue());
}
if (configBean.getPassword().length()>0) {
configBean.setPassword(encryption.decrypt(configBean.getPassword()));
}
}
} catch (ParserConfigurationException ex) {
throw new OKMException(ex);