| 374 | } |
| 375 | |
| 376 | @NotNull |
| 377 | public Properties loadProperties() throws IOException { |
| 378 | final Properties properties = new Properties(); |
| 379 | java.nio.file.Path configFile = Paths.get(rootDirectory, PropServerConfiguration.CONFIG_DIRECTORY, CONFIG_FILE); |
| 380 | log.advisoryW().$("Server config: ").$(configFile).$(); |
| 381 | if (!java.nio.file.Files.exists(configFile)) { |
| 382 | throw new BootstrapException("Server configuration file does not exist! " + configFile, true); |
| 383 | } |
| 384 | if (!java.nio.file.Files.isReadable(configFile)) { |
| 385 | throw new BootstrapException("Server configuration file exists, but is not readable! Check file permissions. " + configFile, true); |
| 386 | } |
| 387 | try (InputStream is = java.nio.file.Files.newInputStream(configFile)) { |
| 388 | properties.load(is); |
| 389 | } |
| 390 | return properties; |
| 391 | } |
| 392 | |
| 393 | public CairoEngine newCairoEngine() { |
| 394 | return new CairoEngine(getConfiguration().getCairoConfiguration()); |