private void reload() { try { JAXBContext jaxbContext = JAXBContext.newInstance(BUSINESS_PACKAGE); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); File file = FileUtils.findGrisbiAccountFile(); lastModified = file.lastModified(); grisbi = (GrisbiXml) unmarshaller.unmarshal(file); } catch (JAXBException e) { e.printStackTrace(); } }
public GrisbiXml loadGrisbi() { if (grisbi == null) { reload(); } else { File file = FileUtils.findGrisbiAccountFile(); if (lastModified < file.lastModified()) { reload(); } } return grisbi; }