James Moger
2011-06-28 d39680e9f54322ddcb40b00503a8ee30aee6c99c
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
18 public class Constants {
19
2a7306 20     public static final String NAME = "Gitblit";
5fe7df 21
2a7306 22     public static final String FULL_NAME = "Gitblit - a pure Java Git solution";
155bf7 23
a4d249 24     // The build script extracts this exact line so be careful editing it
JM 25     // and only use A-Z a-z 0-9 .-_ in the string.
d39680 26     public static final String VERSION = "0.5.1";
JM 27
28     // The build script extracts this exact line so be careful editing it
29     // and only use A-Z a-z 0-9 .-_ in the string.
30     public static final String VERSION_DATE = "2011-06-28";
a4d249 31
2a7306 32     // The build script extracts this exact line so be careful editing it
JM 33     // and only use A-Z a-z 0-9 .-_ in the string.
d0e263 34     public static final String JGIT_VERSION = "JGit 1.0.0 (201106090707-r)";
155bf7 35
2a7306 36     public static final String ADMIN_ROLE = "#admin";
JM 37
38     public static final String PROPERTIES_FILE = "gitblit.properties";
39
5450d0 40     public static final String GIT_PATH = "/git/";
2a7306 41
5450d0 42     public static final String ZIP_PATH = "/zip/";
85c2e6 43
5450d0 44     public static final String SYNDICATION_PATH = "/feed/";
85c2e6 45
1f9dae 46     public static final String BORDER = "***********************************************************";
db653a 47
dfb889 48     public static enum AccessRestrictionType {
JM 49         NONE, PUSH, CLONE, VIEW;
50
d0d438 51         public static AccessRestrictionType fromName(String name) {
dfb889 52             for (AccessRestrictionType type : values()) {
d0d438 53                 if (type.name().equalsIgnoreCase(name)) {
dfb889 54                     return type;
JM 55                 }
56             }
57             return NONE;
58         }
f98825 59
JM 60         public boolean exceeds(AccessRestrictionType type) {
61             return this.ordinal() > type.ordinal();
62         }
63
dfb889 64         public boolean atLeast(AccessRestrictionType type) {
JM 65             return this.ordinal() >= type.ordinal();
66         }
67
68         public String toString() {
f98825 69             return name();
dfb889 70         }
JM 71     }
72
1e47ab 73     public static String getGitBlitVersion() {
JM 74         return NAME + " v" + VERSION;
5fe7df 75     }
JM 76 }