From b9afce4d3db8dec34b22b07c952df814efc7335f Mon Sep 17 00:00:00 2001 From: James Moger Date: Tue, 2 Apr 2013 10:43:52 -0400 Subject: Simplify resource loading --- src/main/java/com/gitblit/GitBlit.java | 11 +++-------- src/main/java/login.mkd | 3 +++ src/main/java/login_es.mkd | 3 +++ src/main/java/login_ko.mkd | 3 +++ src/main/java/login_nl.mkd | 3 +++ src/main/java/login_pl.mkd | 3 +++ src/main/java/login_pt_br.mkd | 3 +++ src/main/java/login_zh_CN.mkd | 3 +++ src/main/java/welcome.mkd | 3 +++ src/main/java/welcome_es.mkd | 3 +++ src/main/java/welcome_ko.mkd | 3 +++ src/main/java/welcome_nl.mkd | 3 +++ src/main/java/welcome_pl.mkd | 3 +++ src/main/java/welcome_pt_br.mkd | 3 +++ src/main/java/welcome_zh_CN.mkd | 3 +++ src/main/resources/login.mkd | 3 --- src/main/resources/login_es.mkd | 3 --- src/main/resources/login_ko.mkd | 3 --- src/main/resources/login_nl.mkd | 3 --- src/main/resources/login_pl.mkd | 3 --- src/main/resources/login_pt_br.mkd | 3 --- src/main/resources/login_zh_CN.mkd | 3 --- src/main/resources/welcome.mkd | 3 --- src/main/resources/welcome_es.mkd | 3 --- src/main/resources/welcome_ko.mkd | 3 --- src/main/resources/welcome_nl.mkd | 3 --- src/main/resources/welcome_pl.mkd | 3 --- src/main/resources/welcome_pt_br.mkd | 3 --- src/main/resources/welcome_zh_CN.mkd | 3 --- 29 files changed, 45 insertions(+), 50 deletions(-) create mode 100644 src/main/java/login.mkd create mode 100644 src/main/java/login_es.mkd create mode 100644 src/main/java/login_ko.mkd create mode 100644 src/main/java/login_nl.mkd create mode 100644 src/main/java/login_pl.mkd create mode 100644 src/main/java/login_pt_br.mkd create mode 100644 src/main/java/login_zh_CN.mkd create mode 100644 src/main/java/welcome.mkd create mode 100644 src/main/java/welcome_es.mkd create mode 100644 src/main/java/welcome_ko.mkd create mode 100644 src/main/java/welcome_nl.mkd create mode 100644 src/main/java/welcome_pl.mkd create mode 100644 src/main/java/welcome_pt_br.mkd create mode 100644 src/main/java/welcome_zh_CN.mkd delete mode 100644 src/main/resources/login.mkd delete mode 100644 src/main/resources/login_es.mkd delete mode 100644 src/main/resources/login_ko.mkd delete mode 100644 src/main/resources/login_nl.mkd delete mode 100644 src/main/resources/login_pl.mkd delete mode 100644 src/main/resources/login_pt_br.mkd delete mode 100644 src/main/resources/login_zh_CN.mkd delete mode 100644 src/main/resources/welcome.mkd delete mode 100644 src/main/resources/welcome_es.mkd delete mode 100644 src/main/resources/welcome_ko.mkd delete mode 100644 src/main/resources/welcome_nl.mkd delete mode 100644 src/main/resources/welcome_pl.mkd delete mode 100644 src/main/resources/welcome_pt_br.mkd delete mode 100644 src/main/resources/welcome_zh_CN.mkd (limited to 'src/main') 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 */ - 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/java/login.mkd b/src/main/java/login.mkd new file mode 100644 index 00000000..51a4cf71 --- /dev/null +++ b/src/main/java/login.mkd @@ -0,0 +1,3 @@ +## Please Login + +Please enter your credentials to access this Gitblit site. diff --git a/src/main/java/login_es.mkd b/src/main/java/login_es.mkd new file mode 100644 index 00000000..700d63f4 --- /dev/null +++ b/src/main/java/login_es.mkd @@ -0,0 +1,3 @@ +## Debes validarte + +Por favor, introduce tus credenciales para acceder Gitblit. \ No newline at end of file diff --git a/src/main/java/login_ko.mkd b/src/main/java/login_ko.mkd new file mode 100644 index 00000000..a48099c1 --- /dev/null +++ b/src/main/java/login_ko.mkd @@ -0,0 +1,3 @@ +## 로그인 하세요 + +이 Gitblit 사이트에 접속하려면 인증정보를 입력하세요. diff --git a/src/main/java/login_nl.mkd b/src/main/java/login_nl.mkd new file mode 100644 index 00000000..38224c96 --- /dev/null +++ b/src/main/java/login_nl.mkd @@ -0,0 +1,3 @@ +## Aanmelden aub + +Vul aub uw aanmeldgegevens in voor toegang tot deze Gitblit site. diff --git a/src/main/java/login_pl.mkd b/src/main/java/login_pl.mkd new file mode 100644 index 00000000..cc7978b4 --- /dev/null +++ b/src/main/java/login_pl.mkd @@ -0,0 +1,3 @@ +## Zaloguj się + +Wprowadź swoje dane uwierzytelniające, aby uzyskać dostęp do instancji Gitblita. diff --git a/src/main/java/login_pt_br.mkd b/src/main/java/login_pt_br.mkd new file mode 100644 index 00000000..6a4a8570 --- /dev/null +++ b/src/main/java/login_pt_br.mkd @@ -0,0 +1,3 @@ +## Faça o Login + +Por favor, entre com suas credenciais para acessar o site Gitblit. diff --git a/src/main/java/login_zh_CN.mkd b/src/main/java/login_zh_CN.mkd new file mode 100644 index 00000000..09046231 --- /dev/null +++ b/src/main/java/login_zh_CN.mkd @@ -0,0 +1,3 @@ +## 请登录 + +请输入身份信息以登陆Gitblit。 \ No newline at end of file diff --git a/src/main/java/welcome.mkd b/src/main/java/welcome.mkd new file mode 100644 index 00000000..130cd8ac --- /dev/null +++ b/src/main/java/welcome.mkd @@ -0,0 +1,3 @@ +## Welcome to Gitblit + +A quick and easy way to host or view your own [Git](http://www.git-scm.com) repositories. diff --git a/src/main/java/welcome_es.mkd b/src/main/java/welcome_es.mkd new file mode 100644 index 00000000..52f290e3 --- /dev/null +++ b/src/main/java/welcome_es.mkd @@ -0,0 +1,3 @@ +## Bienvenid@ a Gitblit + +Una forma fácil y rápida de organizar o ver tus propios repositorios [Git](http://www.git-scm.com) \ No newline at end of file diff --git a/src/main/java/welcome_ko.mkd b/src/main/java/welcome_ko.mkd new file mode 100644 index 00000000..27cd65da --- /dev/null +++ b/src/main/java/welcome_ko.mkd @@ -0,0 +1,3 @@ +## Gitblit 사용을 환영합니다. + +당신의 [Git](http://www.git-scm.com) 저장소를 운영하거나 보기 위한 빠르고 쉬운 방법. diff --git a/src/main/java/welcome_nl.mkd b/src/main/java/welcome_nl.mkd new file mode 100644 index 00000000..406ca1e0 --- /dev/null +++ b/src/main/java/welcome_nl.mkd @@ -0,0 +1,3 @@ +## Welkom bij Gitblit + +Een snelle en makkelijke manier voor het hosten en bekijken van uw eigen [Git](http://www.git-scm.com) repositories. diff --git a/src/main/java/welcome_pl.mkd b/src/main/java/welcome_pl.mkd new file mode 100644 index 00000000..bc60770a --- /dev/null +++ b/src/main/java/welcome_pl.mkd @@ -0,0 +1,3 @@ +## Witaj w aplikacji Gitblit + +Szybko i wygodnie hostuj lub przeglądaj własne repozytoria [GIT](http://www.git-scm.com). diff --git a/src/main/java/welcome_pt_br.mkd b/src/main/java/welcome_pt_br.mkd new file mode 100644 index 00000000..6b30bbcd --- /dev/null +++ b/src/main/java/welcome_pt_br.mkd @@ -0,0 +1,3 @@ +## Bem-Vindo ao Gitblit + +Uma maneira fácil e rápida de armazenar e visualizar o seus próprios repositórios [Git](http://www.git-scm.com). diff --git a/src/main/java/welcome_zh_CN.mkd b/src/main/java/welcome_zh_CN.mkd new file mode 100644 index 00000000..f4a651ef --- /dev/null +++ b/src/main/java/welcome_zh_CN.mkd @@ -0,0 +1,3 @@ +## 欢迎访问 Gitblit + +快速便捷的 [Git](http://www.git-scm.com) 版本库管理方案。 diff --git a/src/main/resources/login.mkd b/src/main/resources/login.mkd deleted file mode 100644 index 51a4cf71..00000000 --- a/src/main/resources/login.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Please Login - -Please enter your credentials to access this Gitblit site. diff --git a/src/main/resources/login_es.mkd b/src/main/resources/login_es.mkd deleted file mode 100644 index 700d63f4..00000000 --- a/src/main/resources/login_es.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Debes validarte - -Por favor, introduce tus credenciales para acceder Gitblit. \ No newline at end of file diff --git a/src/main/resources/login_ko.mkd b/src/main/resources/login_ko.mkd deleted file mode 100644 index a48099c1..00000000 --- a/src/main/resources/login_ko.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## 로그인 하세요 - -이 Gitblit 사이트에 접속하려면 인증정보를 입력하세요. diff --git a/src/main/resources/login_nl.mkd b/src/main/resources/login_nl.mkd deleted file mode 100644 index 38224c96..00000000 --- a/src/main/resources/login_nl.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Aanmelden aub - -Vul aub uw aanmeldgegevens in voor toegang tot deze Gitblit site. diff --git a/src/main/resources/login_pl.mkd b/src/main/resources/login_pl.mkd deleted file mode 100644 index cc7978b4..00000000 --- a/src/main/resources/login_pl.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Zaloguj się - -Wprowadź swoje dane uwierzytelniające, aby uzyskać dostęp do instancji Gitblita. diff --git a/src/main/resources/login_pt_br.mkd b/src/main/resources/login_pt_br.mkd deleted file mode 100644 index 6a4a8570..00000000 --- a/src/main/resources/login_pt_br.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Faça o Login - -Por favor, entre com suas credenciais para acessar o site Gitblit. diff --git a/src/main/resources/login_zh_CN.mkd b/src/main/resources/login_zh_CN.mkd deleted file mode 100644 index 09046231..00000000 --- a/src/main/resources/login_zh_CN.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## 请登录 - -请输入身份信息以登陆Gitblit。 \ No newline at end of file diff --git a/src/main/resources/welcome.mkd b/src/main/resources/welcome.mkd deleted file mode 100644 index 130cd8ac..00000000 --- a/src/main/resources/welcome.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Welcome to Gitblit - -A quick and easy way to host or view your own [Git](http://www.git-scm.com) repositories. diff --git a/src/main/resources/welcome_es.mkd b/src/main/resources/welcome_es.mkd deleted file mode 100644 index 52f290e3..00000000 --- a/src/main/resources/welcome_es.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Bienvenid@ a Gitblit - -Una forma fácil y rápida de organizar o ver tus propios repositorios [Git](http://www.git-scm.com) \ No newline at end of file diff --git a/src/main/resources/welcome_ko.mkd b/src/main/resources/welcome_ko.mkd deleted file mode 100644 index 27cd65da..00000000 --- a/src/main/resources/welcome_ko.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Gitblit 사용을 환영합니다. - -당신의 [Git](http://www.git-scm.com) 저장소를 운영하거나 보기 위한 빠르고 쉬운 방법. diff --git a/src/main/resources/welcome_nl.mkd b/src/main/resources/welcome_nl.mkd deleted file mode 100644 index 406ca1e0..00000000 --- a/src/main/resources/welcome_nl.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Welkom bij Gitblit - -Een snelle en makkelijke manier voor het hosten en bekijken van uw eigen [Git](http://www.git-scm.com) repositories. diff --git a/src/main/resources/welcome_pl.mkd b/src/main/resources/welcome_pl.mkd deleted file mode 100644 index bc60770a..00000000 --- a/src/main/resources/welcome_pl.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Witaj w aplikacji Gitblit - -Szybko i wygodnie hostuj lub przeglądaj własne repozytoria [GIT](http://www.git-scm.com). diff --git a/src/main/resources/welcome_pt_br.mkd b/src/main/resources/welcome_pt_br.mkd deleted file mode 100644 index 6b30bbcd..00000000 --- a/src/main/resources/welcome_pt_br.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## Bem-Vindo ao Gitblit - -Uma maneira fácil e rápida de armazenar e visualizar o seus próprios repositórios [Git](http://www.git-scm.com). diff --git a/src/main/resources/welcome_zh_CN.mkd b/src/main/resources/welcome_zh_CN.mkd deleted file mode 100644 index f4a651ef..00000000 --- a/src/main/resources/welcome_zh_CN.mkd +++ /dev/null @@ -1,3 +0,0 @@ -## 欢迎访问 Gitblit - -快速便捷的 [Git](http://www.git-scm.com) 版本库管理方案。 -- cgit v1.2.3