Examples of SettingsException


Examples of net.csdn.common.exception.SettingsException

            return defaultValue;
        }
        try {
            return Float.parseFloat(sValue);
        } catch (NumberFormatException e) {
            throw new SettingsException("Failed to parse float setting [" + setting + "] with value [" + sValue + "]", e);
        }
    }
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

            return defaultValue;
        }
        try {
            return Double.parseDouble(sValue);
        } catch (NumberFormatException e) {
            throw new SettingsException("Failed to parse double setting [" + setting + "] with value [" + sValue + "]", e);
        }
    }
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

            return defaultValue;
        }
        try {
            return Integer.parseInt(sValue);
        } catch (NumberFormatException e) {
            throw new SettingsException("Failed to parse int setting [" + setting + "] with value [" + sValue + "]", e);
        }
    }
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

            return defaultValue;
        }
        try {
            return Long.parseLong(sValue);
        } catch (NumberFormatException e) {
            throw new SettingsException("Failed to parse long setting [" + setting + "] with value [" + sValue + "]", e);
        }
    }
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

            String setting = (String) o;
            if (setting.startsWith(settingPrefix)) {
                String nameValue = setting.substring(settingPrefix.length());
                int dotIndex = nameValue.indexOf('.');
                if (dotIndex == -1) {
                    throw new SettingsException("Failed to get setting group for [" + settingPrefix + "] setting prefix and setting [" + setting + "] because of a missing '.'");
                }
                String name = nameValue.substring(0, dotIndex);
                String value = nameValue.substring(dotIndex + 1);
                Map<String, String> groupSettings = map.get(name);
                if (groupSettings == null) {
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

        /**
         * Sets the setting group.
         */
        public Builder put(String settingPrefix, String groupName, String[] settings, String[] values) throws SettingsException {
            if (settings.length != values.length) {
                throw new SettingsException("The settings length must match the value length");
            }
            for (int i = 0; i < settings.length; i++) {
                if (values[i] == null) {
                    continue;
                }
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

            try {
                Map<String, String> loadedSettings = YamlSettingsLoader.load(source);
                put(loadedSettings);
            } catch (Exception e) {
                throw new SettingsException("Failed to load settings from [" + source + "]");
            }
            return this;
        }
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

         */
        public Builder loadFromUrl(URL url) throws SettingsException {
            try {
                return loadFromStream(url.toExternalForm(), url.openStream());
            } catch (IOException e) {
                throw new SettingsException("Failed to open stream for url [" + url.toExternalForm() + "]", e);
            }
        }
View Full Code Here

Examples of net.csdn.common.exception.SettingsException

        public Builder loadFromStream(String resourceName, InputStream is) throws SettingsException {
            try {
                Map<String, String> loadedSettings = YamlSettingsLoader.load(Streams.copyToString(new InputStreamReader(is, "UTF-8")));
                put(loadedSettings);
            } catch (Exception e) {
                throw new SettingsException("Failed to load settings from [" + resourceName + "]", e);
            }
            return this;
        }
View Full Code Here

Examples of org.elasticsearch.common.settings.SettingsException

      throws SettingsException {
    String url = null;
    if (config != null)
      url = Utils.trimToNull(XContentMapValues.nodeStringValue(config.get(cfgProperyName), null));
    if (mandatory && url == null) {
      throw new SettingsException("remote/" + cfgProperyName + " element of configuration structure not found or empty");
    }
    if (url != null) {
      try {
        new URL(url);
      } catch (MalformedURLException e) {
        throw new SettingsException("Parameter remote/" + cfgProperyName + " is malformed URL " + e.getMessage());
      }
    }
    return url;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.