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.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. /**
  18. * Constant values used by Gitblit.
  19. *
  20. * @author James Moger
  21. *
  22. */
  23. public class Constants {
  24. public static final String NAME = "Gitblit";
  25. public static final String FULL_NAME = "Gitblit - a pure Java Git solution";
  26. // The build script extracts this exact line so be careful editing it
  27. // and only use A-Z a-z 0-9 .-_ in the string.
  28. public static final String VERSION = "0.5.2";
  29. // The build script extracts this exact line so be careful editing it
  30. // and only use A-Z a-z 0-9 .-_ in the string.
  31. public static final String VERSION_DATE = "2011-07-27";
  32. // The build script extracts this exact line so be careful editing it
  33. // and only use A-Z a-z 0-9 .-_ in the string.
  34. public static final String JGIT_VERSION = "JGit 1.0.0 (201106090707-r)";
  35. public static final String ADMIN_ROLE = "#admin";
  36. public static final String PROPERTIES_FILE = "gitblit.properties";
  37. public static final String GIT_PATH = "/git/";
  38. public static final String ZIP_PATH = "/zip/";
  39. public static final String SYNDICATION_PATH = "/feed/";
  40. public static final String BORDER = "***********************************************************";
  41. /**
  42. * Enumeration representing the 4 access restriction levels.
  43. */
  44. public static enum AccessRestrictionType {
  45. NONE, PUSH, CLONE, VIEW;
  46. public static AccessRestrictionType fromName(String name) {
  47. for (AccessRestrictionType type : values()) {
  48. if (type.name().equalsIgnoreCase(name)) {
  49. return type;
  50. }
  51. }
  52. return NONE;
  53. }
  54. public boolean exceeds(AccessRestrictionType type) {
  55. return this.ordinal() > type.ordinal();
  56. }
  57. public boolean atLeast(AccessRestrictionType type) {
  58. return this.ordinal() >= type.ordinal();
  59. }
  60. public String toString() {
  61. return name();
  62. }
  63. }
  64. public static String getGitBlitVersion() {
  65. return NAME + " v" + VERSION;
  66. }
  67. }