You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Constants.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package com.gitblit;
  2. public class Constants {
  3. public final static String NAME = "Git:Blit";
  4. public final static String FULL_NAME = "Git:Blit - a Pure Java Git Solution";
  5. // The build script extracts this exact line so be careful editing it
  6. // and only use A-Z a-z 0-9 .-_ in the string.
  7. public final static String VERSION = "0.1.0-SNAPSHOT";
  8. // The build script extracts this exact line so be careful editing it
  9. // and only use A-Z a-z 0-9 .-_ in the string.
  10. public final static String JGIT_VERSION = "JGit 0.12.1";
  11. public final static String ADMIN_ROLE = "#admin";
  12. public final static String PROPERTIES_FILE = "gitblit.properties";
  13. public final static String GIT_SERVLET_PATH = "/git/";
  14. public final static String ZIP_SERVLET_PATH = "/zip/";
  15. public static enum AccessRestrictionType {
  16. NONE, PUSH, CLONE, VIEW;
  17. public static AccessRestrictionType fromName(String name) {
  18. for (AccessRestrictionType type : values()) {
  19. if (type.name().equalsIgnoreCase(name)) {
  20. return type;
  21. }
  22. }
  23. return NONE;
  24. }
  25. public boolean exceeds(AccessRestrictionType type) {
  26. return this.ordinal() > type.ordinal();
  27. }
  28. public boolean atLeast(AccessRestrictionType type) {
  29. return this.ordinal() >= type.ordinal();
  30. }
  31. public String toString() {
  32. return name();
  33. }
  34. }
  35. public static String getGitBlitVersion() {
  36. return NAME + " v" + VERSION;
  37. }
  38. public static String getJGitVersion() {
  39. return JGIT_VERSION;
  40. }
  41. public static String getRunningVersion() {
  42. return getGitBlitVersion();
  43. }
  44. }