public BitbucketRepositoryFork forkRepository(@NotNull final String owner,@NotNull final String repositorySlug,@NotNull final String forkName,final boolean isForkPrivate) throws IOException, BitbucketException, ServerException {
  checkArgument(!isNullOrEmpty(owner),"owner");
  checkArgument(!isNullOrEmpty(repositorySlug),"repositorySlug");
  checkArgument(!isNullOrEmpty(forkName),"forkName");
  final String url=BITBUCKET_1_0_API_URL + "/repositories/" + owner+ "/"+ repositorySlug+ "/fork";
  final String data="name=" + encode(forkName,"UTF-8") + "&is_private="+ isForkPrivate;
  final String response=doRequest(POST,url,OK,APPLICATION_FORM_URLENCODED,data);
  return parseJsonResponse(response,BitbucketRepositoryFork.class);
}

public BitbucketRepositoryFork forkRepository ( @ NotNull final String owner , @ NotNull final String repositorySlug , @ NotNull final String forkName , final boolean isForkPrivate ) throws IOException , BitbucketException , ServerException { checkArgument ( ! isNullOrEmpty ( owner ) , "owner" ) ; checkArgument ( ! isNullOrEmpty ( repositorySlug ) , "repositorySlug" ) ; checkArgument ( ! isNullOrEmpty ( forkName ) , "forkName" ) ; final String url = BITBUCKET_1_0_API_URL + "/repositories/" + owner + "/" + repositorySlug + "/fork" ; final String data = "name=" + encode ( forkName , "UTF-8" ) + "&is_private=" + isForkPrivate ; final String response = doRequest ( POST , url , OK , APPLICATION_FORM_URLENCODED , data ) ; return parseJsonResponse ( response , BitbucketRepositoryFork . class ) ; }
fork a bitbucket repository .
