From 669686f6118544bf2122f1e7f3e39c5dbc9654f5 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sat, 18 Jun 2011 09:02:00 -0400
Subject: [PATCH] Improved web.xml builder. Now it includes the parameter comments.
---
src/com/gitblit/IStoredSettings.java | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/com/gitblit/IStoredSettings.java b/src/com/gitblit/IStoredSettings.java
index 7108c06..403a067 100644
--- a/src/com/gitblit/IStoredSettings.java
+++ b/src/com/gitblit/IStoredSettings.java
@@ -27,21 +27,25 @@
public abstract class IStoredSettings {
protected final Logger logger;
-
+
public IStoredSettings(Class<? extends IStoredSettings> clazz) {
logger = LoggerFactory.getLogger(clazz);
}
-
+
protected abstract Properties read();
public List<String> getAllKeys(String startingWith) {
- startingWith = startingWith.toLowerCase();
List<String> keys = new ArrayList<String>();
Properties props = read();
- for (Object o : props.keySet()) {
- String key = o.toString();
- if (key.toLowerCase().startsWith(startingWith)) {
- keys.add(key);
+ if (StringUtils.isEmpty(startingWith)) {
+ keys.addAll(props.stringPropertyNames());
+ } else {
+ startingWith = startingWith.toLowerCase();
+ for (Object o : props.keySet()) {
+ String key = o.toString();
+ if (key.toLowerCase().startsWith(startingWith)) {
+ keys.add(key);
+ }
}
}
return keys;
--
Gitblit v1.9.1