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