From 553e0f79c99e3c3b6e7fb5364c10cfc1bd3b9c80 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Sun, 04 May 2014 10:43:35 -0400 Subject: [PATCH] Stream directly from repo instead of loading into ram and streaming --- src/main/java/com/gitblit/Constants.java | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/gitblit/Constants.java b/src/main/java/com/gitblit/Constants.java index 889e5a3..96f13c8 100644 --- a/src/main/java/com/gitblit/Constants.java +++ b/src/main/java/com/gitblit/Constants.java @@ -68,6 +68,8 @@ public static final String SPARKLESHARE_INVITE_PATH = "/sparkleshare/"; + public static final String BRANCH = "/branch/"; + public static final String BRANCH_GRAPH_PATH = "/graph/"; public static final String BORDER = "*****************************************************************"; @@ -423,6 +425,8 @@ public static final AccessPermission [] NEWPERMISSIONS = { EXCLUDE, VIEW, CLONE, PUSH, CREATE, DELETE, REWIND }; + public static final AccessPermission [] SSHPERMISSIONS = { VIEW, CLONE, PUSH }; + public static AccessPermission LEGACY = REWIND; public final String code; @@ -501,7 +505,7 @@ } public static enum AuthenticationType { - SSH, CREDENTIALS, COOKIE, CERTIFICATE, CONTAINER; + PUBLIC_KEY, CREDENTIALS, COOKIE, CERTIFICATE, CONTAINER; public boolean isStandard() { return ordinal() <= COOKIE.ordinal(); @@ -538,6 +542,25 @@ } } + public static enum Transport { + // ordered for url advertisements, assuming equal access permissions + SSH, HTTPS, HTTP, GIT; + + public static Transport fromString(String value) { + for (Transport t : values()) { + if (t.name().equalsIgnoreCase(value)) { + return t; + } + } + return null; + } + + public static Transport fromUrl(String url) { + String scheme = url.substring(0, url.indexOf("://")); + return fromString(scheme); + } + } + @Documented @Retention(RetentionPolicy.RUNTIME) public @interface Unused { -- Gitblit v1.9.1