public GHContentUpdateResponse delete(String commitMessage, String branch) throws IOException { Requester requester = new Requester(root) .with("path", path) .with("message", commitMessage) .with("sha", sha) .method("DELETE"); if (branch != null) { requester.with("branch", branch); } GHContentUpdateResponse response = requester.to(getApiRoute(), GHContentUpdateResponse.class); response.getCommit().wrapUp(repository); return response; }
public GHContentUpdateResponse update(byte[] newContentBytes, String commitMessage, String branch) throws IOException { String encodedContent = Base64.encodeBase64String(newContentBytes); Requester requester = new Requester(root) .with("path", path) .with("message", commitMessage) .with("sha", sha) .with("content", encodedContent) .method("PUT"); if (branch != null) { requester.with("branch", branch); } GHContentUpdateResponse response = requester.to(getApiRoute(), GHContentUpdateResponse.class); response.getContent().wrap(repository); response.getCommit().wrapUp(repository); this.content = encodedContent; return response; }
public GHContentUpdateResponse delete(String commitMessage, String branch) throws IOException { Requester requester = new Requester(root) .with("path", path) .with("message", commitMessage) .with("sha", sha) .method("DELETE"); if (branch != null) { requester.with("branch", branch); } GHContentUpdateResponse response = requester.to(getApiRoute(), GHContentUpdateResponse.class); response.getCommit().wrapUp(repository); return response; }
public GHContentUpdateResponse delete(String commitMessage, String branch) throws IOException { Requester requester = new Requester(root) .with("path", path) .with("message", commitMessage) .with("sha", sha) .method("DELETE"); if (branch != null) { requester.with("branch", branch); } GHContentUpdateResponse response = requester.to(getApiRoute(), GHContentUpdateResponse.class); response.getCommit().wrapUp(repository); return response; }
public GHContentUpdateResponse update(byte[] newContentBytes, String commitMessage, String branch) throws IOException { String encodedContent = Base64.encodeBase64String(newContentBytes); Requester requester = new Requester(root) .with("path", path) .with("message", commitMessage) .with("sha", sha) .with("content", encodedContent) .method("PUT"); if (branch != null) { requester.with("branch", branch); } GHContentUpdateResponse response = requester.to(getApiRoute(), GHContentUpdateResponse.class); response.getContent().wrap(repository); response.getCommit().wrapUp(repository); this.content = encodedContent; return response; }
public GHContentUpdateResponse update(byte[] newContentBytes, String commitMessage, String branch) throws IOException { String encodedContent = DatatypeConverter.printBase64Binary(newContentBytes); Requester requester = new Requester(root) .with("path", path) .with("message", commitMessage) .with("sha", sha) .with("content", encodedContent) .method("PUT"); if (branch != null) { requester.with("branch", branch); } GHContentUpdateResponse response = requester.to(getApiRoute(), GHContentUpdateResponse.class); response.getContent().wrap(repository); response.getCommit().wrapUp(repository); this.content = encodedContent; return response; }