summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/StringUtils.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-06-18 08:28:47 -0400
committerJames Moger <james.moger@gitblit.com>2011-06-18 08:28:47 -0400
commit5450d08e4cd11176bcc50a5b3d001d291bd8982c (patch)
treeba1f99a65b25be6e63f5057be177483bd6bd7382 /src/com/gitblit/utils/StringUtils.java
parent8c9a2037b5c0fed881a3ad6dd9cff364eed603d9 (diff)
downloadgitblit-5450d08e4cd11176bcc50a5b3d001d291bd8982c.tar.gz
gitblit-5450d08e4cd11176bcc50a5b3d001d291bd8982c.zip
Mostly stable war build.
Reorganization of resources. Dropped most hard-coded webapp configuration in favor of common web.xml file. Still contemplating configuring git servlet from web.xml too.
Diffstat (limited to 'src/com/gitblit/utils/StringUtils.java')
-rw-r--r--src/com/gitblit/utils/StringUtils.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java
index 363efc9c..b53b5e15 100644
--- a/src/com/gitblit/utils/StringUtils.java
+++ b/src/com/gitblit/utils/StringUtils.java
@@ -16,16 +16,12 @@
package com.gitblit.utils;
import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.PatternSyntaxException;
-import org.eclipse.jetty.util.log.Log;
-import org.eclipse.jgit.util.Base64;
-
public class StringUtils {
public static final String MD5_TYPE = "MD5:";
@@ -152,9 +148,10 @@ public class StringUtils {
md.update(string.getBytes("iso-8859-1"));
byte[] digest = md.digest();
return toHex(digest);
- } catch (Exception e) {
- Log.warn(e);
- return null;
+ } catch (UnsupportedEncodingException u) {
+ throw new RuntimeException(u);
+ } catch (NoSuchAlgorithmException t) {
+ throw new RuntimeException(t);
}
}
@@ -168,11 +165,7 @@ public class StringUtils {
}
return sb.toString();
}
-
- public static String decodeBase64(String base64) {
- return new String(Base64.decode(base64), Charset.forName("UTF-8"));
- }
-
+
public static String getRootPath(String path) {
if (path.indexOf('/') > -1) {
return path.substring(0, path.lastIndexOf('/'));