| | |
| | | } |
| | | |
| | | /** |
| | | * Determine if this Gitblit instance is actively serving git repositories |
| | | * or if it is merely a repository viewer. |
| | | * |
| | | * @return true if Gitblit is serving repositories |
| | | */ |
| | | public static boolean isServingRepositories() { |
| | | return getBoolean(Keys.git.enableGitServlet, true) || (getInteger(Keys.git.daemonPort, 0) > 0); |
| | | } |
| | | |
| | | /** |
| | | * Determine if this Gitblit instance is actively serving git repositories |
| | | * or if it is merely a repository viewer. |
| | | * |
| | | * @return true if Gitblit is serving repositories |
| | | */ |
| | | public static boolean isSendingMail() { |
| | | return self().mailExecutor.isReady(); |
| | | } |
| | | |
| | | /** |
| | | * Returns the preferred timezone for the Gitblit instance. |
| | | * |
| | | * @return a timezone |
| | |
| | | */ |
| | | public static int getInteger(String key, int defaultValue) { |
| | | return self().settings.getInteger(key, defaultValue); |
| | | } |
| | | |
| | | /** |
| | | * Returns the integer list for the specified key. If the key does not |
| | | * exist or the value for the key can not be interpreted as an integer, an |
| | | * empty list is returned. |
| | | * |
| | | * @see IStoredSettings.getIntegers(String key) |
| | | * @param key |
| | | * @return key value or defaultValue |
| | | */ |
| | | public static List<Integer> getIntegers(String key) { |
| | | return self().settings.getIntegers(key); |
| | | } |
| | | |
| | | /** |
| | |
| | | Constants.CONFIG_GITBLIT, null, "mailingList"))); |
| | | model.indexedBranches = new ArrayList<String>(Arrays.asList(config.getStringList( |
| | | Constants.CONFIG_GITBLIT, null, "indexBranch"))); |
| | | model.metricAuthorExclusions = new ArrayList<String>(Arrays.asList(config.getStringList( |
| | | Constants.CONFIG_GITBLIT, null, "metricAuthorExclusions"))); |
| | | |
| | | // Custom defined properties |
| | | model.customFields = new LinkedHashMap<String, String>(); |
| | |
| | | updateList(config, "postReceiveScript", repository.postReceiveScripts); |
| | | updateList(config, "mailingList", repository.mailingLists); |
| | | updateList(config, "indexBranch", repository.indexedBranches); |
| | | updateList(config, "metricAuthorExclusions", repository.metricAuthorExclusions); |
| | | |
| | | // User Defined Properties |
| | | if (repository.customFields != null) { |
| | |
| | | if (repository != null) { |
| | | for (String teamname : userService.getTeamnamesForRepositoryRole(repository.name)) { |
| | | TeamModel team = userService.getTeamModel(teamname); |
| | | scripts.addAll(team.preReceiveScripts); |
| | | if (!ArrayUtils.isEmpty(team.preReceiveScripts)) { |
| | | scripts.addAll(team.preReceiveScripts); |
| | | } |
| | | } |
| | | } |
| | | return new ArrayList<String>(scripts); |
| | |
| | | if (repository != null) { |
| | | for (String teamname : userService.getTeamnamesForRepositoryRole(repository.name)) { |
| | | TeamModel team = userService.getTeamModel(teamname); |
| | | scripts.addAll(team.postReceiveScripts); |
| | | if (!ArrayUtils.isEmpty(team.postReceiveScripts)) { |
| | | scripts.addAll(team.postReceiveScripts); |
| | | } |
| | | } |
| | | } |
| | | return new ArrayList<String>(scripts); |