class GitForkCmd extends BaseCommand {

   @Override
   public ICmdResult execute() {
      CmdResult result = new CmdResult();
      String sourceOrganization = getSourceOrganization(m_gitUrl);
      String sourceRepo = getSourceRepo(m_gitUrl);

      String forkUrl = Config.getInstance().getGitAPIUrl() + sourceOrganization + "/" + sourceRepo + "/forks";

      try {
         ResteasyClient client = new ResteasyClientBuilder().build();
         client.register(new BasicAuthentication(m_userName, m_password));
         client.register(new AgentHeadersRequestFilter(m_userName));

         ResteasyWebTarget target = client.target(forkUrl);

         Organization o = new Organization(m_organization);
         Response response = target.request().post(Entity.entity(o, "application/json"));
         if ((response.getStatus() == 201) || (response.getStatus() == 202)) {
            String resStr = response.readEntity(String.class);
            JSONObject jsonObject = new JSONObject(resStr);
            //System.out.println("Get response:" + jsonObject);
            //System.out.println(jsonObject.get("html_url"));
            try {
               m_forkedGitUrl = jsonObject.get("html_url").toString();
            } catch (JSONException e) {
               e.printStackTrace();
               result.setException(e);
            }

            result.setMessage("OK");
         } else {
            System.err.println("Unexpected response status:" + response.getStatus());
            throw new RuntimeException("Unexpected response status:" + response.getStatus() + "  "
                  + response.readEntity(String.class));

         }

         // step 2: wait due to async fork restful api
         if (result.getException() == null) {
            waitForkComplete(client, forkUrl);
         }

      } catch (Exception ex) {
         result.setException(ex);
      }

      return result;
   }

   public  GitForkCmd(String name);

}