From 33ef3c2fb81744ed3f21a64f30a818531f1dd7e9 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Thu, 27 Mar 2014 09:01:28 -0400 Subject: [PATCH] Add a method to test for the existence of a setting --- 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 9c7a2d2..13dca6b 100644 --- a/src/main/java/com/gitblit/IStoredSettings.java +++ b/src/main/java/com/gitblit/IStoredSettings.java @@ -343,6 +343,16 @@ } /** + * 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. * -- Gitblit v1.9.1