reader.readEntities(entityClass); store.flush();
private static Collection<Stop> readStopsFromGtfsPath(String path, String defaultAgencyId) throws IOException { GtfsReader reader = new GtfsReader(); reader.setInputLocation(new File(path)); if (defaultAgencyId != null) reader.setDefaultAgencyId(defaultAgencyId); reader.readEntities(Agency.class); reader.readEntities(Stop.class); return reader.getEntityStore().getAllEntitiesForType(Stop.class); }
private static Collection<Stop> readStopsFromGtfsPath(String path) throws IOException { String defaultAgencyId = null; int index = path.indexOf(File.pathSeparatorChar); if( index != -1) { defaultAgencyId = path.substring(index+1); path = path.substring(0,index); } GtfsReader reader = new GtfsReader(); reader.setInputLocation(new File(path)); if( defaultAgencyId != null) reader.setDefaultAgencyId(defaultAgencyId); reader.readEntities(Agency.class); reader.readEntities(Stop.class); return reader.getEntityStore().getAllEntitiesForType(Stop.class); } }
private static Collection<Stop> readStopsFromGtfsPath(String path, String defaultAgencyId) throws IOException { GtfsReader reader = new GtfsReader(); reader.setInputLocation(new File(path)); if (defaultAgencyId != null) reader.setDefaultAgencyId(defaultAgencyId); reader.readEntities(Agency.class); reader.readEntities(Stop.class); return reader.getEntityStore().getAllEntitiesForType(Stop.class); }
public void run(CsvInputSource source) throws IOException { List<Class<?>> classes = getEntityClasses(); _entityStore.open(); for (Class<?> entityClass : classes) { _log.info("reading entities: " + entityClass.getName()); readEntities(entityClass, source); _entityStore.flush(); } _entityStore.close(); }
public void run(CsvInputSource source) throws IOException { List<Class<?>> classes = getEntityClasses(); _entityStore.open(); for (Class<?> entityClass : classes) { _log.info("reading entities: " + entityClass.getName()); readEntities(entityClass, source); _entityStore.flush(); } _entityStore.close(); }
reader.setAgencies(agencies); reader.readEntities(entityClass);
reader.setAgencies(agencies); reader.readEntities(entityClass);
reader.setAgencies(agencies); reader.readEntities(entityClass);
if (bundle.getDefaultAgencyId() != null) reader.setDefaultAgencyId(bundle.getDefaultAgencyId()); reader.readEntities(Stop.class);
if (bundle.getDefaultAgencyId() != null) reader.setDefaultAgencyId(bundle.getDefaultAgencyId()); reader.readEntities(Stop.class);
if (bundle.getDefaultAgencyId() != null) reader.setDefaultAgencyId(bundle.getDefaultAgencyId()); reader.readEntities(Stop.class);