From a5f60417e38043d35148aa6873c93056e69e9c87 Mon Sep 17 00:00:00 2001 From: Robin Beer Date: Thu, 5 Oct 2023 15:35:20 +0100 Subject: [PATCH] refactor(Added export prop file param): --- .../conveyal/gtfs/loader/JdbcGtfsExporter.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/conveyal/gtfs/loader/JdbcGtfsExporter.java b/src/main/java/com/conveyal/gtfs/loader/JdbcGtfsExporter.java index 9e84f7301..b0e5d9666 100644 --- a/src/main/java/com/conveyal/gtfs/loader/JdbcGtfsExporter.java +++ b/src/main/java/com/conveyal/gtfs/loader/JdbcGtfsExporter.java @@ -44,6 +44,9 @@ public class JdbcGtfsExporter { private final DataSource dataSource; private final boolean fromEditor; + /** If this is true will export tables prefixed with {@link Table#PROPRIETARY_FILE_PREFIX} **/ + private final boolean exportProprietaryFiles; + // These fields will be filled in once feed snapshot begins. private Connection connection; private ZipOutputStream zipOutputStream; @@ -66,6 +69,15 @@ public JdbcGtfsExporter(String feedId, String outFile, DataSource dataSource, bo this.outFile = outFile; this.dataSource = dataSource; this.fromEditor = fromEditor; + this.exportProprietaryFiles = true; + } + + public JdbcGtfsExporter(String feedId, String outFile, DataSource dataSource, boolean fromEditor, boolean exportProprietaryFiles) { + this.feedIdToExport = feedId; + this.outFile = outFile; + this.dataSource = dataSource; + this.fromEditor = fromEditor; + this.exportProprietaryFiles = exportProprietaryFiles; } /** @@ -242,7 +254,9 @@ public FeedLoadResult exportTables() { result.routes = export(Table.ROUTES, connection); } - result.patterns = export(Table.PATTERNS, connection); + if (exportProprietaryFiles) { + result.patterns = export(Table.PATTERNS, connection); + } // Only write shapes for "approved" routes using COPY TO with results of select query if (fromEditor) { // Generate filter SQL for shapes if exporting a feed/schema that represents an editor snapshot.