From 93f0b1a11d5a7f7c44cfcb8ff5300bb68b8b8188 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Sat, 01 Oct 2011 17:30:48 -0400 Subject: [PATCH] Refactored federation servlet and utils. Started rpc servlet and utils. --- src/com/gitblit/GitBlit.java | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index c35340a..e86fcf6 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -63,9 +63,8 @@ import com.gitblit.models.UserModel; import com.gitblit.utils.FederationUtils; import com.gitblit.utils.JGitUtils; +import com.gitblit.utils.JsonUtils; import com.gitblit.utils.StringUtils; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; /** * GitBlit is the servlet context listener singleton that acts as the core for @@ -978,8 +977,7 @@ */ public boolean submitFederationProposal(FederationProposal proposal, String gitblitUrl) { // convert proposal to json - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - String json = gson.toJson(proposal); + String json = JsonUtils.toJsonString(proposal); try { // make the proposals folder @@ -1025,10 +1023,9 @@ && file.getName().toLowerCase().endsWith(Constants.PROPOSAL_EXT); } }); - Gson gson = new Gson(); for (File file : files) { String json = com.gitblit.utils.FileUtils.readContent(file, null); - FederationProposal proposal = gson.fromJson(json, FederationProposal.class); + FederationProposal proposal = JsonUtils.fromJsonString(json, FederationProposal.class); list.add(proposal); } } -- Gitblit v1.9.1