Source:
public static GraphHopperStorage createOrLoad(GHDirectory directory, EncodingManager encodingManager, PtFlagEncoder ptFlagEncoder, GtfsStorage gtfsStorage, boolean createWalkNetwork, Collection<String> gtfsFiles, Collection<String> osmFiles) { GraphHopperStorage graphHopperStorage = new GraphHopperStorage(directory, encodingManager, false, gtfsStorage); if (graphHopperStorage.loadExisting()) { return graphHopperStorage; } else { graphHopperStorage.create(1000); for (String osmFile : osmFiles) { OSMReader osmReader = new OSMReader(graphHopperStorage); osmReader.setFile(new File(osmFile)); osmReader.setCreateStorage(false); try { osmReader.readGraph(); } catch (IOException e) { throw new RuntimeException(e); } } int id = 0; for (String gtfsFile : gtfsFiles) { try { ((GtfsStorage) graphHopperStorage.getExtension()).loadGtfsFromFile("gtfs_" + id++, new ZipFile(gtfsFile)); } catch (IOException e) { throw new RuntimeException(e); } } if (createWalkNetwork) { FakeWalkNetworkBuilder.buildWalkNetwork(((GtfsStorage) graphHopperStorage.getExtension()).getGtfsFeeds().values(), graphHopperStorage, ptFlagEncoder, Helper.DIST_EARTH); } LocationIndex walkNetworkIndex; if (graphHopperStorage.getNodes() > 0) { walkNetworkIndex = new LocationIndexTree(graphHopperStorage, new RAMDirectory()).prepareIndex(); } else { walkNetworkIndex = new EmptyLocationIndex(); } for (int i = 0; i < id; i++) { new GtfsReader("gtfs_" + i, graphHopperStorage, gtfsStorage, ptFlagEncoder, walkNetworkIndex).readGraph(); } new PrepareRoutingSubnetworks(graphHopperStorage, Collections.singletonList(ptFlagEncoder)).doWork(); graphHopperStorage.flush(); return graphHopperStorage; } }

Target:
public static GraphHopperStorage createOrLoad(GHDirectory directory, EncodingManager encodingManager, PtFlagEncoder ptFlagEncoder, GtfsStorage gtfsStorage, boolean createWalkNetwork, Collection<String> gtfsFiles, Collection<String> osmFiles) { GraphHopperStorage graphHopperStorage = new GraphHopperStorage(directory, encodingManager, false, gtfsStorage); if (graphHopperStorage.loadExisting()) { return graphHopperStorage; } else { graphHopperStorage.create(1000); for (String osmFile : osmFiles) { OSMReader osmReader = new OSMReader(graphHopperStorage); osmReader.setFile(new File(osmFile)); osmReader.setCreateStorage(false); try { osmReader.readGraph(); } catch (IOException e) { throw new RuntimeException(e); } } new PrepareRoutingSubnetworks(graphHopperStorage, Collections.singletonList(ptFlagEncoder)).doWork(); int id = 0; for (String gtfsFile : gtfsFiles) { try { ((GtfsStorage) graphHopperStorage.getExtension()).loadGtfsFromFile("gtfs_" + id++, new ZipFile(gtfsFile)); } catch (IOException e) { throw new RuntimeException(e); } } if (createWalkNetwork) { FakeWalkNetworkBuilder.buildWalkNetwork(((GtfsStorage) graphHopperStorage.getExtension()).getGtfsFeeds().values(), graphHopperStorage, ptFlagEncoder, Helper.DIST_EARTH); } LocationIndex walkNetworkIndex; if (graphHopperStorage.getNodes() > 0) { walkNetworkIndex = new LocationIndexTree(graphHopperStorage, new RAMDirectory()).prepareIndex(); } else { walkNetworkIndex = new EmptyLocationIndex(); } for (int i = 0; i < id; i++) { new GtfsReader("gtfs_" + i, graphHopperStorage, gtfsStorage, ptFlagEncoder, walkNetworkIndex).readGraph(); } graphHopperStorage.flush(); return graphHopperStorage; } }