|
13 | 13 | import org.opentripplanner.raptor.configure.RaptorConfig;
|
14 | 14 | import org.opentripplanner.routing.graph.SerializedGraphObject;
|
15 | 15 | import org.opentripplanner.standalone.config.CommandLineParameters;
|
| 16 | +import org.opentripplanner.standalone.config.ConfigModel; |
16 | 17 | import org.opentripplanner.standalone.configure.ConstructApplication;
|
17 | 18 | import org.opentripplanner.standalone.configure.LoadApplication;
|
18 | 19 | import org.opentripplanner.standalone.server.GrizzlyServer;
|
@@ -113,13 +114,7 @@ private static void startOTPServer(CommandLineParameters cli) {
|
113 | 114 | var loadApp = new LoadApplication(cli);
|
114 | 115 | var config = loadApp.config();
|
115 | 116 |
|
116 |
| - // optionally check if the config is valid and if not abort the startup process |
117 |
| - if (cli.configCheck && config.hasInvalidProperties()) { |
118 |
| - throw new OtpAppException( |
119 |
| - "Configuration contains invalid properties (see above for details). " + |
120 |
| - "Please fix your configuration or remove --configCheck from your OTP CLI parameters." |
121 |
| - ); |
122 |
| - } |
| 117 | + detectUnusedConfigParams(cli, config); |
123 | 118 |
|
124 | 119 | // Validate data sources, command line arguments and config before loading and
|
125 | 120 | // processing input data to fail early
|
@@ -180,6 +175,18 @@ private static void startOTPServer(CommandLineParameters cli) {
|
180 | 175 | }
|
181 | 176 | }
|
182 | 177 |
|
| 178 | + /** |
| 179 | + * Optionally, check if the config is valid and if not abort the startup process. |
| 180 | + */ |
| 181 | + private static void detectUnusedConfigParams(CommandLineParameters cli, ConfigModel config) { |
| 182 | + if (cli.configCheck && config.hasIUnknownProperties()) { |
| 183 | + throw new OtpAppException( |
| 184 | + "Configuration contains invalid properties (see above for details). " + |
| 185 | + "Please fix your configuration or remove --configCheck from your OTP CLI parameters." |
| 186 | + ); |
| 187 | + } |
| 188 | + } |
| 189 | + |
183 | 190 | private static void startOtpWebServer(CommandLineParameters params, ConstructApplication app) {
|
184 | 191 | // Index graph for travel search
|
185 | 192 | app.transitModel().index();
|
|
0 commit comments