diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-27 09:01:28 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-27 09:01:28 -0400 |
commit | 33ef3c2fb81744ed3f21a64f30a818531f1dd7e9 (patch) | |
tree | 06e169d54152b57691ceac3b7ba023999c7ec27d /src/main/java/com/gitblit/IStoredSettings.java | |
parent | d23a1ce6ebe1b348fe21aefd5402f562609151fd (diff) | |
download | gitblit-33ef3c2fb81744ed3f21a64f30a818531f1dd7e9.tar.gz gitblit-33ef3c2fb81744ed3f21a64f30a818531f1dd7e9.zip |
Add a method to test for the existence of a setting
Diffstat (limited to 'src/main/java/com/gitblit/IStoredSettings.java')
-rw-r--r-- | src/main/java/com/gitblit/IStoredSettings.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/IStoredSettings.java b/src/main/java/com/gitblit/IStoredSettings.java index 9c7a2d23..13dca6b6 100644 --- a/src/main/java/com/gitblit/IStoredSettings.java +++ b/src/main/java/com/gitblit/IStoredSettings.java @@ -343,6 +343,16 @@ public abstract class IStoredSettings { }
/**
+ * Tests for the existence of a setting.
+ *
+ * @param key
+ * @return true if the setting exists
+ */
+ public boolean hasSettings(String key) {
+ return getString(key, null) != null;
+ }
+
+ /**
* Updates the values for the specified keys and persists the entire
* configuration file.
*
|