From f8dc86f1b362c2906ea302eb56928b59156cd484 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Wed, 27 Jul 2011 09:40:57 -0400 Subject: [PATCH] Renamed README for GutHub. --- src/com/gitblit/IStoredSettings.java | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/com/gitblit/IStoredSettings.java b/src/com/gitblit/IStoredSettings.java index b380c63..be836c9 100644 --- a/src/com/gitblit/IStoredSettings.java +++ b/src/com/gitblit/IStoredSettings.java @@ -118,6 +118,26 @@ } /** + * Returns the char value for the specified key. If the key does not exist + * or the value for the key can not be interpreted as a char, the + * defaultValue is returned. + * + * @param key + * @param defaultValue + * @return key value or defaultValue + */ + public char getChar(String name, char defaultValue) { + Properties props = getSettings(); + if (props.containsKey(name)) { + String value = props.getProperty(name); + if (!StringUtils.isEmpty(value)) { + return value.charAt(0); + } + } + return defaultValue; + } + + /** * Returns the string value for the specified key. If the key does not exist * or the value for the key can not be interpreted as a string, the * defaultValue is returned. -- Gitblit v1.9.1