From bd0e83e350fc703bcae72a28c41b09d9a9cec594 Mon Sep 17 00:00:00 2001 From: Paul Martin Date: Sat, 10 Oct 2015 12:46:51 +0100 Subject: Git-LFS support + Metadata maintained in append-only JSON file providing complete audit history. + Filestore menu item + Lists filestore items + Current size and availability + Link to GitBlit Filestore help page (top right) + Hooks into existing repository permissions + Uses default repository path for out-of-box operation with Git-LFS client + accessRestrictionFilter now has access to http method and auth header + Testing for servlet and manager --- src/main/java/com/gitblit/utils/JsonUtils.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/gitblit/utils/JsonUtils.java') diff --git a/src/main/java/com/gitblit/utils/JsonUtils.java b/src/main/java/com/gitblit/utils/JsonUtils.java index be7148cb..f389776b 100644 --- a/src/main/java/com/gitblit/utils/JsonUtils.java +++ b/src/main/java/com/gitblit/utils/JsonUtils.java @@ -46,6 +46,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; @@ -79,23 +80,29 @@ public class JsonUtils { /** * Convert a json string to an object of the specified type. - * + * * @param json * @param clazz - * @return an object + * @return the deserialized object + * @throws JsonParseException + * @throws JsonSyntaxException */ - public static X fromJsonString(String json, Class clazz) { + public static X fromJsonString(String json, Class clazz) throws JsonParseException, + JsonSyntaxException { return gson().fromJson(json, clazz); } /** * Convert a json string to an object of the specified type. - * + * * @param json - * @param clazz - * @return an object + * @param type + * @return the deserialized object + * @throws JsonParseException + * @throws JsonSyntaxException */ - public static X fromJsonString(String json, Type type) { + public static X fromJsonString(String json, Type type) throws JsonParseException, + JsonSyntaxException { return gson().fromJson(json, type); } -- cgit v1.2.3