Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Constants.java 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  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. */
  16. package com.gitblit;
  17. public class Constants {
  18. public static final String NAME = "Gitblit";
  19. public static final String FULL_NAME = "Gitblit - a pure Java Git solution";
  20. // The build script extracts this exact line so be careful editing it
  21. // and only use A-Z a-z 0-9 .-_ in the string.
  22. public static final String VERSION = "0.1.0-SNAPSHOT";
  23. // The build script extracts this exact line so be careful editing it
  24. // and only use A-Z a-z 0-9 .-_ in the string.
  25. public static final String JGIT_VERSION = "JGit 0.12.1";
  26. public static final String ADMIN_ROLE = "#admin";
  27. public static final String PROPERTIES_FILE = "gitblit.properties";
  28. public static final String GIT_SERVLET_PATH = "/git/";
  29. public static final String ZIP_SERVLET_PATH = "/zip/";
  30. public static final String SYNDICATION_SERVLET_PATH = "/feed/";
  31. public static final String BORDER = "***********************************************************";
  32. public static enum AccessRestrictionType {
  33. NONE, PUSH, CLONE, VIEW;
  34. public static AccessRestrictionType fromName(String name) {
  35. for (AccessRestrictionType type : values()) {
  36. if (type.name().equalsIgnoreCase(name)) {
  37. return type;
  38. }
  39. }
  40. return NONE;
  41. }
  42. public boolean exceeds(AccessRestrictionType type) {
  43. return this.ordinal() > type.ordinal();
  44. }
  45. public boolean atLeast(AccessRestrictionType type) {
  46. return this.ordinal() >= type.ordinal();
  47. }
  48. public String toString() {
  49. return name();
  50. }
  51. }
  52. public static String getGitBlitVersion() {
  53. return NAME + " v" + VERSION;
  54. }
  55. }