James Moger
2011-07-27 85e8b6b09771ee07f2f28eb4d8b3d74a6232e7d3
commit | author | age
f13c4c 1 /*
JM 2  * Copyright 2011 gitblit.com.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
5fe7df 16 package com.gitblit;
JM 17
892570 18 /**
JM 19  * Constant values used by Gitblit.
20  * 
21  * @author James Moger
22  * 
23  */
5fe7df 24 public class Constants {
JM 25
2a7306 26     public static final String NAME = "Gitblit";
5fe7df 27
2a7306 28     public static final String FULL_NAME = "Gitblit - a pure Java Git solution";
155bf7 29
a4d249 30     // The build script extracts this exact line so be careful editing it
JM 31     // and only use A-Z a-z 0-9 .-_ in the string.
85e8b6 32     public static final String VERSION = "0.5.2";
d39680 33
JM 34     // The build script extracts this exact line so be careful editing it
35     // and only use A-Z a-z 0-9 .-_ in the string.
85e8b6 36     public static final String VERSION_DATE = "2011-07-27";
a4d249 37
2a7306 38     // The build script extracts this exact line so be careful editing it
JM 39     // and only use A-Z a-z 0-9 .-_ in the string.
d0e263 40     public static final String JGIT_VERSION = "JGit 1.0.0 (201106090707-r)";
155bf7 41
2a7306 42     public static final String ADMIN_ROLE = "#admin";
JM 43
44     public static final String PROPERTIES_FILE = "gitblit.properties";
45
5450d0 46     public static final String GIT_PATH = "/git/";
2a7306 47
5450d0 48     public static final String ZIP_PATH = "/zip/";
85c2e6 49
5450d0 50     public static final String SYNDICATION_PATH = "/feed/";
85c2e6 51
1f9dae 52     public static final String BORDER = "***********************************************************";
db653a 53
88598b 54     /**
JM 55      * Enumeration representing the 4 access restriction levels.
56      */
dfb889 57     public static enum AccessRestrictionType {
JM 58         NONE, PUSH, CLONE, VIEW;
59
d0d438 60         public static AccessRestrictionType fromName(String name) {
dfb889 61             for (AccessRestrictionType type : values()) {
d0d438 62                 if (type.name().equalsIgnoreCase(name)) {
dfb889 63                     return type;
JM 64                 }
65             }
66             return NONE;
67         }
f98825 68
JM 69         public boolean exceeds(AccessRestrictionType type) {
70             return this.ordinal() > type.ordinal();
71         }
72
dfb889 73         public boolean atLeast(AccessRestrictionType type) {
JM 74             return this.ordinal() >= type.ordinal();
75         }
76
77         public String toString() {
f98825 78             return name();
dfb889 79         }
JM 80     }
81
1e47ab 82     public static String getGitBlitVersion() {
JM 83         return NAME + " v" + VERSION;
5fe7df 84     }
JM 85 }