| | |
| | | *
|
| | | * @return Map<String, SettingModel>
|
| | | */
|
| | | private ServerSettings loadSettingModels() {
|
| | | private ServerSettings loadSettingModels(InputStream referencePropertiesInputStream) {
|
| | | ServerSettings settingsModel = new ServerSettings();
|
| | | settingsModel.supportsCredentialChanges = userService.supportsCredentialChanges();
|
| | | settingsModel.supportsDisplayNameChanges = userService.supportsDisplayNameChanges();
|
| | |
| | | // Read bundled Gitblit properties to extract setting descriptions.
|
| | | // This copy is pristine and only used for populating the setting
|
| | | // models map.
|
| | | InputStream is = getClass().getResourceAsStream("/reference.properties");
|
| | | InputStream is = referencePropertiesInputStream;
|
| | | BufferedReader propertiesReader = new BufferedReader(new InputStreamReader(is));
|
| | | StringBuilder description = new StringBuilder();
|
| | | SettingModel setting = new SettingModel();
|
| | |
| | | * @see ServletContextListener.contextInitialize(ServletContextEvent)
|
| | | */
|
| | | @Override
|
| | | public void contextInitialized(ServletContextEvent contextEvent) {
|
| | | public void contextInitialized(ServletContextEvent contextEvent) {
|
| | | contextInitialized(contextEvent, getClass().getResourceAsStream("/reference.properties"));
|
| | | }
|
| | |
|
| | | public void contextInitialized(ServletContextEvent contextEvent, InputStream referencePropertiesInputStream) {
|
| | | servletContext = contextEvent.getServletContext();
|
| | | if (settings == null) {
|
| | | // Gitblit is running in a servlet container
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | settingsModel = loadSettingModels();
|
| | | settingsModel = loadSettingModels(referencePropertiesInputStream);
|
| | | serverStatus.servletContainer = servletContext.getServerInfo();
|
| | | }
|
| | |
|