Skip to content

Commit

Permalink
refactor(Added export prop file param):
Browse files Browse the repository at this point in the history
  • Loading branch information
br648 committed Oct 5, 2023
1 parent 90bf5f0 commit a5f6041
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/com/conveyal/gtfs/loader/JdbcGtfsExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

/**
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a5f6041

Please sign in to comment.