Writes a list of PlanConfigs to given file.
(List<PlanConfig> planConfigs, File outputDir)
| 136 | * Writes a list of PlanConfigs to given file. |
| 137 | */ |
| 138 | public static void writeConfigs(List<PlanConfig> planConfigs, File outputDir) { |
| 139 | File outFile = new File(outputDir, PLAN_FILE); |
| 140 | ObjectMapper mapper = new ObjectMapper( |
| 141 | new YAMLFactory() |
| 142 | .disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER) |
| 143 | .enable(YAMLGenerator.Feature.MINIMIZE_QUOTES)); |
| 144 | try { |
| 145 | logger.info("Writing analysis plan to {}", outFile.getAbsolutePath()); |
| 146 | mapper.writeValue(outFile, planConfigs); |
| 147 | } catch (IOException e) { |
| 148 | throw new ConfigException("Failed to write plan file to " |
| 149 | + outFile.getAbsolutePath(), e); |
| 150 | } |
| 151 | } |
| 152 | } |