public String put(String key, String value, boolean isEncrypted) {
        if (value == null) {
            // This is the same as deleting, so remove it.
            return remove(key);
        }
        if (key == null) {
            throw new NullPointerException("Key cannot be null. Key=" +
                    key + ", value=" + value);
        }
        if (key.endsWith(".")) {
            key = key.substring(0, key.length()-1);
        }
        key = key.trim();
        String result;
        synchronized (this) {
            if (properties.containsKey(key)) {
                updateProperty(key, value, isEncrypted);
            }
            else {
                insertProperty(key, value, isEncrypted);
            }

            result = properties.put(key, value);
            encrypted.put(key, isEncrypted);
            // We now know the database is correct - so we can remove the entry from security.conf
            JiveGlobals.clearXMLPropertyEncryptionEntry(key);
        }

        // Generate event.
        Map<String, Object> params = new HashMap<>();
        params.put("value", value);
        PropertyEventDispatcher.dispatchEvent(key, PropertyEventDispatcher.EventType.property_set, params);

        // Send update to other cluster members.
        CacheFactory.doClusterTask(PropertyClusterEventTask.createPutTask(key, value, isEncrypted));

        return result;
    }
Saves a property, optionally encrypting it

@param key
           The name of the property
@param value
           The value of the property
@param isEncrypted
           {@code true} to encrypt the property, {@code true} to leave in plain text
@return The previous value associated with {@code key}, or {@code null} if there was no mapping for
        {@code key}.
xmppserver/src/main/java/org/jivesoftware/util/JiveProperties.java