/** * Return all values who's path matches the given property * name as a String array, or an empty array if the if there * are no children. This allows you to retrieve several values * with the same property name. For example, consider the * XML file entry: * <pre> * <foo> * <bar> * <prop>some value</prop> * <prop>other value</prop> * <prop>last value</prop> * </bar> * </foo> * </pre> * If you call getProperties("foo.bar.prop") will return a string array containing * {"some value", "other value", "last value"}. * * @deprecated Retained for backward compatibility. Prefer getProperties(String, boolean) * @param name the name of the property to retrieve * @return all child property values for the given node name. */ public String[] getProperties(String name) { return (String[]) getProperties(name, false).toArray(); }
/** * Determines whether an XML property is configured for encryption. * * @param name * The name of the property * @return {@code true} if the property is stored using encryption, otherwise {@code false} */ public static boolean isXMLPropertyEncrypted(final String name) { if (securityProperties == null) { loadSecurityProperties(); } return name != null && !name.startsWith(JiveGlobals.ENCRYPTED_PROPERTY_NAME_PREFIX) && securityProperties.getProperties(JiveGlobals.ENCRYPTED_PROPERTY_NAMES, true).contains(name); }
/** * Removes the given value from the list of values represented by the property name. * The property is deleted if it no longer contains any values. * * @param propertyName The name of the property list to change * @param value The value to be removed from the list * @return True if the value was removed from the list; false if the value was not found */ public boolean removeFromList(String propertyName, String value) { List<String> properties = getProperties(propertyName, true); boolean propertyWasRemoved = properties.remove(value); if (propertyWasRemoved) { setProperties(propertyName, properties); } return propertyWasRemoved; }
/** * Adds the given value to the list of values represented by the property name. * The property is created if it did not already exist. * * @param propertyName The name of the property list to change * @param value The value to be added to the list * @return True if the value was added to the list; false if the value was already present */ public boolean addToList(String propertyName, String value) { List<String> properties = getProperties(propertyName, true); boolean propertyWasAdded = properties.add(value); if (propertyWasAdded) { setProperties(propertyName, properties); } return propertyWasAdded; }
for (String propertyName : securityProperties.getProperties(ENCRYPTED_PROPERTY_NAMES, true)) { Log.info("Updating encrypted value for " + propertyName); if (openfireProps.containsKey(propertyName)) {
/** * Return all values who's path matches the given property * name as a String array, or an empty array if the if there * are no children. This allows you to retrieve several values * with the same property name. For example, consider the * XML file entry: * <pre> * <foo> * <bar> * <prop>some value</prop> * <prop>other value</prop> * <prop>last value</prop> * </bar> * </foo> * </pre> * If you call getProperties("foo.bar.prop") will return a string array containing * {"some value", "other value", "last value"}. * * @deprecated Retained for backward compatibility. Prefer getProperties(String, boolean) * @param name the name of the property to retrieve * @return all child property values for the given node name. */ public String[] getProperties(String name) { return (String[]) getProperties(name, false).toArray(); }
/** * Determines whether an XML property is configured for encryption. * * @param name * The name of the property * @return {@code true} if the property is stored using encryption, otherwise {@code false} */ static boolean isXMLPropertyEncrypted(final String name) { if (securityProperties == null) { loadSecurityProperties(); } return name != null && !name.startsWith(JiveGlobals.ENCRYPTED_PROPERTY_NAME_PREFIX) && securityProperties.getProperties(JiveGlobals.ENCRYPTED_PROPERTY_NAMES, true).contains(name); }
/** * Adds the given value to the list of values represented by the property name. * The property is created if it did not already exist. * * @param propertyName The name of the property list to change * @param value The value to be added to the list * @return True if the value was added to the list; false if the value was already present */ public boolean addToList(String propertyName, String value) { List<String> properties = getProperties(propertyName, true); boolean propertyWasAdded = properties.add(value); if (propertyWasAdded) { setProperties(propertyName, properties); } return propertyWasAdded; }
/** * Removes the given value from the list of values represented by the property name. * The property is deleted if it no longer contains any values. * * @param propertyName The name of the property list to change * @param value The value to be removed from the list * @return True if the value was removed from the list; false if the value was not found */ public boolean removeFromList(String propertyName, String value) { List<String> properties = getProperties(propertyName, true); boolean propertyWasRemoved = properties.remove(value); if (propertyWasRemoved) { setProperties(propertyName, properties); } return propertyWasRemoved; }
for (String propertyName : securityProperties.getProperties(ENCRYPTED_PROPERTY_NAMES, true)) { Log.info("Updating encrypted value for " + propertyName); if (openfireProps.containsKey(propertyName)) {