public void process(File file, Storage storage) throws IOException, JAXBException {
String packageName = "gov.nysenate.openleg.xml.committee";
JAXBContext jc = JAXBContext.newInstance(packageName);
Unmarshaller u = jc.createUnmarshaller();
XMLSENATEDATA senateData = (XMLSENATEDATA)u.unmarshal(new FileReader(file));
// TODO: We need a better default here
modifiedDate = null;
try {
modifiedDate = sobiDateFormat.parse(file.getName());
} catch (ParseException e) {
logger.error("Error parsing file date.", e);
}
ChangeLogger.setContext(file, modifiedDate);
for(Object next : senateData.getSenagendaOrSenagendavote()) {
if (next instanceof XMLSenagenda) {
Agenda agenda = handleXMLSenagenda(storage,(XMLSenagenda)next);
if (agenda != null) {
agenda.addDataSource(file.getName());