public static ConfigModel parse(Path p) throws ProvisioningException { try(BufferedReader reader = Files.newBufferedReader(p)) { return INSTANCE.parse(reader); } catch (Exception e) { throw new ProvisioningException(Errors.parseXml(p), e); } }
ConfigModel getConfig(ConfigId configId) throws ProvisioningException { if(configs != null) { final ConfigModel config = configs.get(configId); if(config != null) { return config; } } final Path p = LayoutUtils.getConfigXml(dir, configId, false); if (!Files.exists(p)) { return null; } try (BufferedReader reader = Files.newBufferedReader(p)) { final ConfigModel config = ConfigXmlParser.getInstance().parse(reader); if (configs == null) { configs = new HashMap<>(); } configs.put(config.getId(), config); return config; } catch (Exception e) { throw new ProvisioningException(Errors.parseXml(p), e); } }
if (customConfig != null && Files.exists(customConfig)) { try (BufferedReader reader = Files.newBufferedReader(customConfig)) { config = ConfigXmlParser.getInstance().parse(reader); } catch (XMLStreamException | IOException ex) { throw new IllegalArgumentException("Couldn't load the customization configuration " + customConfig, ex);
if (customConfig != null && Files.exists(customConfig)) { try (BufferedReader reader = Files.newBufferedReader(customConfig)) { config = ConfigXmlParser.getInstance().parse(reader); } catch (XMLStreamException | IOException ex) { throw new IllegalArgumentException("Couldn't load the customization configuration " + customConfig, ex);
state.addConfig(ConfigXmlParser.getInstance().parse(reader)); } catch (XMLStreamException | IOException ex) { throw new IllegalArgumentException("Couldn't load the customization configuration " + customConfig, ex);
state.addConfig(ConfigXmlParser.getInstance().parse(reader)); } catch (XMLStreamException | IOException ex) { throw new IllegalArgumentException("Couldn't load the customization configuration " + customConfig, ex);