summaryrefslogtreecommitdiffstats
path: root/src/main/java/com
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-04-02 10:43:52 -0400
committerJames Moger <james.moger@gitblit.com>2013-04-02 10:43:52 -0400
commitb9afce4d3db8dec34b22b07c952df814efc7335f (patch)
treecfbaa4692a9a1365f1528ae2b7b66c0df8fedb44 /src/main/java/com
parent0f47b2f605ed4119a6042b72d3499b223f40ec90 (diff)
downloadgitblit-b9afce4d3db8dec34b22b07c952df814efc7335f.tar.gz
gitblit-b9afce4d3db8dec34b22b07c952df814efc7335f.zip
Simplify resource loading
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/gitblit/GitBlit.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java
index 1a817ab7..566a917e 100644
--- a/src/main/java/com/gitblit/GitBlit.java
+++ b/src/main/java/com/gitblit/GitBlit.java
@@ -2997,11 +2997,10 @@ public class GitBlit implements ServletContextListener {
* Parse the properties file and aggregate all the comments by the setting
* key. A setting model tracks the current value, the default value, the
* description of the setting and and directives about the setting.
- * @param referencePropertiesInputStream
*
* @return Map<String, SettingModel>
*/
- private ServerSettings loadSettingModels(InputStream referencePropertiesInputStream) {
+ private ServerSettings loadSettingModels() {
ServerSettings settingsModel = new ServerSettings();
settingsModel.supportsCredentialChanges = userService.supportsCredentialChanges();
settingsModel.supportsDisplayNameChanges = userService.supportsDisplayNameChanges();
@@ -3011,7 +3010,7 @@ public class GitBlit implements ServletContextListener {
// Read bundled Gitblit properties to extract setting descriptions.
// This copy is pristine and only used for populating the setting
// models map.
- InputStream is = referencePropertiesInputStream;
+ InputStream is = getClass().getResourceAsStream("/reference.properties");
BufferedReader propertiesReader = new BufferedReader(new InputStreamReader(is));
StringBuilder description = new StringBuilder();
SettingModel setting = new SettingModel();
@@ -3239,10 +3238,6 @@ public class GitBlit implements ServletContextListener {
*/
@Override
public void contextInitialized(ServletContextEvent contextEvent) {
- contextInitialized(contextEvent, contextEvent.getServletContext().getResourceAsStream("/WEB-INF/reference.properties"));
- }
-
- public void contextInitialized(ServletContextEvent contextEvent, InputStream referencePropertiesInputStream) {
servletContext = contextEvent.getServletContext();
if (settings == null) {
// Gitblit is running in a servlet container
@@ -3307,7 +3302,7 @@ public class GitBlit implements ServletContextListener {
}
}
- settingsModel = loadSettingModels(referencePropertiesInputStream);
+ settingsModel = loadSettingModels();
serverStatus.servletContainer = servletContext.getServerInfo();
}