   public void performHttp(HttpServletRewrite event, EvaluationContext context)
   {
      Gson gson = new Gson();
      try {
         String jsonString = event.getRequest().getParameter("payload");
         System.out.println(jsonString);
         Map json = gson.fromJson(jsonString, Map.class);
         StringMap repository = (StringMap) json.get("repository");
         String repo = (String) repository.get("url");
         if (!repo.endsWith(".git"))
            repo = repo + ".git";
         File repoDir = new File(root, safeFileName.transpose(event, context, repo));
         File cacheDir = new File(root, safeFileName.transpose(event, context, repo) + "-cache");
         if (!repoDir.exists())
         {
            repoDir.mkdirs();
            cacheDir.mkdirs();
            Git.cloneRepository().setURI(repo)
                     .setCloneAllBranches(true).setDirectory(repoDir).call();
         }
         else
         {
            try {
               Git git = GitUtils.git(repoDir);
               GitUtils.pull(git, 15);
               deleteRecursively(cacheDir);
               cacheDir.mkdirs();
            }
            catch (GitAPIException e) {
               throw new RewriteException("Could not pull from git repository.", e);
            }
         }
      }
      catch (Exception e) {
         throw new RewriteException("Error parsing update hook", e);
      }
   }

   public void performHttp(HttpServletRewrite event, EvaluationContext context)
   {
      Gson gson = new Gson();
      try {
         String jsonString = event.getRequest().getParameter("payload");
         System.out.println(jsonString);
         Map json = gson.fromJson(jsonString, Map.class);
         StringMap repository = (StringMap) json.get("repository");
         String repo = (String) repository.get("url");
         if (!repo.endsWith(".git"))
            repo = repo + ".git";
         File repoDir = new File(root, safeFileName.transpose(event, context, repo) + "/repo");
         File cacheDir = new File(root, safeFileName.transpose(event, context, repo) + "/caches");
         if (!repoDir.exists())
         {
            repoDir.mkdirs();
            cacheDir.mkdirs();
            Git.cloneRepository().setURI(repo)
                     .setCloneAllBranches(true).setDirectory(repoDir).call();
         }
         else
         {
            try {
               Git git = GitUtils.git(repoDir);
               GitUtils.pull(git, 15);
               deleteRecursively(cacheDir);
               cacheDir.mkdirs();
            }
            catch (GitAPIException e) {
               throw new RewriteException("Could not pull from git repository.", e);
            }
         }
      }
      catch (Exception e) {
         throw new RewriteException("Error parsing update hook", e);
      }
   }
