* @throws ObjectNotFoundException
*/
public static XmlIDGenerator getIDGenerator(File file)
throws ObjectNotFoundException {
if (!file.exists()) {
throw new ObjectNotFoundException("IDGenerator not found in idgen.xml");
}
try {
Document document = XmlUtil.parse(new FileInputStream(file));
org.w3c.dom.Element tmp = (Element) document.getDocumentElement()
.getElementsByTagName("counter")
.item(0);
return new XmlIDGenerator(Long.parseLong(XmlUtil.getTextContent(tmp)));
} catch (Exception e) {
throw new ObjectNotFoundException(e.toString());
}
}