Writes options to given file.
(Options options, File output)
| 397 | * Writes options to given file. |
| 398 | */ |
| 399 | private static void writeOptions(Options options, File output) { |
| 400 | ObjectMapper mapper = new ObjectMapper( |
| 401 | new YAMLFactory() |
| 402 | .disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER) |
| 403 | .enable(YAMLGenerator.Feature.MINIMIZE_QUOTES)); |
| 404 | try { |
| 405 | logger.info("Writing options to {}", output.getAbsolutePath()); |
| 406 | mapper.writeValue(output, options); |
| 407 | } catch (IOException e) { |
| 408 | throw new ConfigException("Failed to write options to " |
| 409 | + output.getAbsolutePath(), e); |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | /** |
| 414 | * Represents a file that supports placeholder and automatically replaces it |