use of org.onebusaway.gtfs.services.GenericMutableDao in project onebusaway-gtfs-modules by OneBusAway.
the class GtfsTransformer method readGtfs.
/**
**
* Protected Methods
***
*/
/**
**
* Private Methods
***
*/
private void readGtfs() throws IOException {
GenericMutableDao dao = _dao;
if (!_entityTransformStrategies.isEmpty())
dao = new DaoInterceptor(_dao);
DefaultEntitySchemaFactory schemaFactory = new DefaultEntitySchemaFactory();
schemaFactory.addFactory(GtfsEntitySchemaFactory.createEntitySchemaFactory());
_transformStrategies.forEach(s -> s.updateReadSchema(schemaFactory));
_reader.setEntitySchemaFactory(schemaFactory);
_reader.setEntityStore(dao);
if (_agencyId != null)
_reader.setDefaultAgencyId(_agencyId);
for (File path : _gtfsInputDirectories) {
_log.info("reading gtfs from " + path);
if (path.isFile()) {
FileTime fileTime = ((FileTime) Files.readAttributes(path.toPath(), "lastModifiedTime").get("lastModifiedTime"));
if (fileTime != null) {
_log.info("found lastModifiedTime of " + new Date(fileTime.toMillis()));
_reader.setLastModifiedTime(fileTime.toMillis());
}
}
_reader.setInputLocation(path);
_reader.run();
}
}
use of org.onebusaway.gtfs.services.GenericMutableDao in project onebusaway-gtfs-modules by OneBusAway.
the class GtfsTransformer method readReferenceGtfs.
private void readReferenceGtfs() throws IOException {
_log.info("reading reference GTFS at " + _gtfsReferenceDirectory);
GenericMutableDao dao = new GtfsRelationalDaoImpl();
_referenceReader.setEntityStore(dao);
if (_agencyId != null)
_referenceReader.setDefaultAgencyId(_agencyId);
_referenceReader.setInputLocation(_gtfsReferenceDirectory);
_referenceReader.run();
_context.setReferenceReader(_referenceReader);
}
Aggregations