summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/IStoredSettings.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-03-27 09:01:28 -0400
committerJames Moger <james.moger@gitblit.com>2014-03-27 09:01:28 -0400
commit33ef3c2fb81744ed3f21a64f30a818531f1dd7e9 (patch)
tree06e169d54152b57691ceac3b7ba023999c7ec27d /src/main/java/com/gitblit/IStoredSettings.java
parentd23a1ce6ebe1b348fe21aefd5402f562609151fd (diff)
downloadgitblit-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.java10
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.
*