Read a list of PlanConfig from given file.
(File file)
| 93 | * Read a list of PlanConfig from given file. |
| 94 | */ |
| 95 | public static List<PlanConfig> readConfigs(File file) { |
| 96 | ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); |
| 97 | JavaType type = mapper.getTypeFactory() |
| 98 | .constructCollectionType(List.class, PlanConfig.class); |
| 99 | try { |
| 100 | return mapper.readValue(file, type); |
| 101 | } catch (IOException e) { |
| 102 | throw new ConfigException("Failed to read plan file " + file, e); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Reads a list of PlanConfig from options. |