List of utility methods to do Properties Get
String | getSignatureContent(Properties properties) get Signature Content StringBuffer content = new StringBuffer(); List keys = new ArrayList(properties.keySet()); Collections.sort(keys); for (int i = 0; i < keys.size(); i++) { String key = (String) keys.get(i); String value = properties.getProperty(key); content.append(String.valueOf(i != 0 ? "&" : "") + key + "=" + value); return content.toString(); |
Set | getSignExclusions(Properties properties) get Sign Exclusions if (properties == null) return Collections.EMPTY_SET; String signExcludes = properties.getProperty(SIGN_EXCLUDES); if (signExcludes != null) { String[] excludes = toStringArray(signExcludes, ","); Set signExclusions = new HashSet(); for (int i = 0; i < excludes.length; i++) { signExclusions.add(excludes[i]); ... |
String | getString(Properties props, String key) get String String value = ""; if (props.containsKey(key)) { value = props.getProperty(key); return value; |
String | getString(Properties props, String name) get String if (props.containsKey(name)) { return props.getProperty(name).trim(); throw new IllegalArgumentException("Missing required property '" + name + "'"); |
String | getString(Properties props, String name, String defaultValue) Get a string property, or, if no such property is defined, return the given default value return props.containsKey(name) ? props.getProperty(name) : defaultValue;
|
Optional | getStringConfigValue(final String configKey, final Properties config) get String Config Value final String configValue = config.getProperty(configKey); final Optional<String> optionalConfigValue; if (configValue != null && !configValue.trim().isEmpty()) { optionalConfigValue = Optional.of(configValue); } else { optionalConfigValue = Optional.empty(); return optionalConfigValue; ... |
String | getStringConfigVaule(Properties properties, String key, String defaultValue) get String Config Vaule return checkConfigValue(properties, key, defaultValue) ? properties.getProperty(key) : null;
|
Properties | getSubProperties(Properties src, String prefix) get Sub Properties Properties persistenceProps = new Properties(); for (String key : src.stringPropertyNames()) { if (key.startsWith(prefix)) { String value = src.getProperty(key); persistenceProps.setProperty(key, value); return persistenceProps; ... |
String | getValue(Properties properties, String key) get Value if (properties == null || key == null || key.isEmpty()) { return ""; return properties.getProperty(key, ""); |