From a4d2498b7f94012cfdf481fcf151f8cfd7537a42 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 23 May 2011 16:46:09 -0400
Subject: [PATCH] User list. Revised home page. Updated Jetty. Secure cookies. Docs.

---
 src/com/gitblit/utils/StringUtils.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java
index 6d646df..8b7960b 100644
--- a/src/com/gitblit/utils/StringUtils.java
+++ b/src/com/gitblit/utils/StringUtils.java
@@ -5,8 +5,9 @@
 import java.security.NoSuchAlgorithmException;
 import java.util.List;
 
+
 public class StringUtils {
-	
+
 	public static boolean isEmpty(String value) {
 		return value == null || value.trim().length() == 0;
 	}
@@ -106,5 +107,11 @@
 			throw new RuntimeException(t);
 		}
 	}
-
+	
+	public static String getRootPath(String path) {
+		if (path.indexOf('/') > -1) {
+			return path.substring(0, path.indexOf('/'));
+		}
+		return "";
+	}
 }

--
Gitblit v1.9.1