public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
public Config loadConfig(URL url) throws ConfigurationException { try { logger.debug("Loading settings from {}", url); byte[] configBytes; try (InputStream is = url.openStream()) { configBytes = ByteStreams.toByteArray(is); } catch (IOException e) { // getStorageConfigURL should have ruled this out throw new AssertionError(e); } Constructor constructor = new CustomConstructor(Config.class); PropertiesChecker propertiesChecker = new PropertiesChecker(); constructor.setPropertyUtils(propertiesChecker); Yaml yaml = new Yaml(constructor); Config result = loadConfig(yaml, configBytes); propertiesChecker.check(); return result; } catch (YAMLException e) { throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR + " Error: " + e.getMessage(), false); } }
CustomConstructor(Class<?> theRoot) { super(theRoot); TypeDescription seedDesc = new TypeDescription(ParameterizedClass.class); seedDesc.putMapPropertyType("parameters", String.class, String.class); addTypeDescription(seedDesc); }
CustomConstructor(Class<?> theRoot) { super(theRoot); TypeDescription seedDesc = new TypeDescription(ParameterizedClass.class); seedDesc.putMapPropertyType("parameters", String.class, String.class); addTypeDescription(seedDesc); }
CustomConstructor(Class<?> theRoot) { super(theRoot); TypeDescription seedDesc = new TypeDescription(ParameterizedClass.class); seedDesc.putMapPropertyType("parameters", String.class, String.class); addTypeDescription(seedDesc); }
CustomConstructor(Class<?> theRoot) { super(theRoot); TypeDescription seedDesc = new TypeDescription(ParameterizedClass.class); seedDesc.putMapPropertyType("parameters", String.class, String.class); addTypeDescription(seedDesc); }