summaryrefslogtreecommitdiffstats
path: root/src/main
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
parent0f47b2f605ed4119a6042b72d3499b223f40ec90 (diff)
downloadgitblit-b9afce4d3db8dec34b22b07c952df814efc7335f.tar.gz
gitblit-b9afce4d3db8dec34b22b07c952df814efc7335f.zip
Simplify resource loading
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/gitblit/GitBlit.java11
-rw-r--r--src/main/java/login.mkd (renamed from src/main/resources/login.mkd)0
-rw-r--r--src/main/java/login_es.mkd (renamed from src/main/resources/login_es.mkd)0
-rw-r--r--src/main/java/login_ko.mkd (renamed from src/main/resources/login_ko.mkd)0
-rw-r--r--src/main/java/login_nl.mkd (renamed from src/main/resources/login_nl.mkd)0
-rw-r--r--src/main/java/login_pl.mkd (renamed from src/main/resources/login_pl.mkd)0
-rw-r--r--src/main/java/login_pt_br.mkd (renamed from src/main/resources/login_pt_br.mkd)0
-rw-r--r--src/main/java/login_zh_CN.mkd (renamed from src/main/resources/login_zh_CN.mkd)0
-rw-r--r--src/main/java/welcome.mkd (renamed from src/main/resources/welcome.mkd)0
-rw-r--r--src/main/java/welcome_es.mkd (renamed from src/main/resources/welcome_es.mkd)0
-rw-r--r--src/main/java/welcome_ko.mkd (renamed from src/main/resources/welcome_ko.mkd)0
-rw-r--r--src/main/java/welcome_nl.mkd (renamed from src/main/resources/welcome_nl.mkd)0
-rw-r--r--src/main/java/welcome_pl.mkd (renamed from src/main/resources/welcome_pl.mkd)0
-rw-r--r--src/main/java/welcome_pt_br.mkd (renamed from src/main/resources/welcome_pt_br.mkd)0
-rw-r--r--src/main/java/welcome_zh_CN.mkd (renamed from src/main/resources/welcome_zh_CN.mkd)0
15 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();
}
diff --git a/src/main/resources/login.mkd b/src/main/java/login.mkd
index 51a4cf71..51a4cf71 100644
--- a/src/main/resources/login.mkd
+++ b/src/main/java/login.mkd
diff --git a/src/main/resources/login_es.mkd b/src/main/java/login_es.mkd
index 700d63f4..700d63f4 100644
--- a/src/main/resources/login_es.mkd
+++ b/src/main/java/login_es.mkd
diff --git a/src/main/resources/login_ko.mkd b/src/main/java/login_ko.mkd
index a48099c1..a48099c1 100644
--- a/src/main/resources/login_ko.mkd
+++ b/src/main/java/login_ko.mkd
diff --git a/src/main/resources/login_nl.mkd b/src/main/java/login_nl.mkd
index 38224c96..38224c96 100644
--- a/src/main/resources/login_nl.mkd
+++ b/src/main/java/login_nl.mkd
diff --git a/src/main/resources/login_pl.mkd b/src/main/java/login_pl.mkd
index cc7978b4..cc7978b4 100644
--- a/src/main/resources/login_pl.mkd
+++ b/src/main/java/login_pl.mkd
diff --git a/src/main/resources/login_pt_br.mkd b/src/main/java/login_pt_br.mkd
index 6a4a8570..6a4a8570 100644
--- a/src/main/resources/login_pt_br.mkd
+++ b/src/main/java/login_pt_br.mkd
diff --git a/src/main/resources/login_zh_CN.mkd b/src/main/java/login_zh_CN.mkd
index 09046231..09046231 100644
--- a/src/main/resources/login_zh_CN.mkd
+++ b/src/main/java/login_zh_CN.mkd
diff --git a/src/main/resources/welcome.mkd b/src/main/java/welcome.mkd
index 130cd8ac..130cd8ac 100644
--- a/src/main/resources/welcome.mkd
+++ b/src/main/java/welcome.mkd
diff --git a/src/main/resources/welcome_es.mkd b/src/main/java/welcome_es.mkd
index 52f290e3..52f290e3 100644
--- a/src/main/resources/welcome_es.mkd
+++ b/src/main/java/welcome_es.mkd
diff --git a/src/main/resources/welcome_ko.mkd b/src/main/java/welcome_ko.mkd
index 27cd65da..27cd65da 100644
--- a/src/main/resources/welcome_ko.mkd
+++ b/src/main/java/welcome_ko.mkd
diff --git a/src/main/resources/welcome_nl.mkd b/src/main/java/welcome_nl.mkd
index 406ca1e0..406ca1e0 100644
--- a/src/main/resources/welcome_nl.mkd
+++ b/src/main/java/welcome_nl.mkd
diff --git a/src/main/resources/welcome_pl.mkd b/src/main/java/welcome_pl.mkd
index bc60770a..bc60770a 100644
--- a/src/main/resources/welcome_pl.mkd
+++ b/src/main/java/welcome_pl.mkd
diff --git a/src/main/resources/welcome_pt_br.mkd b/src/main/java/welcome_pt_br.mkd
index 6b30bbcd..6b30bbcd 100644
--- a/src/main/resources/welcome_pt_br.mkd
+++ b/src/main/java/welcome_pt_br.mkd
diff --git a/src/main/resources/welcome_zh_CN.mkd b/src/main/java/welcome_zh_CN.mkd
index f4a651ef..f4a651ef 100644
--- a/src/main/resources/welcome_zh_CN.mkd
+++ b/src/main/java/welcome_zh_CN.mkd