/*package*/ GHTag wrap(GHRepository owner) { this.owner = owner; this.root = owner.root; if (commit!=null) commit.wrapUp(owner); return this; }
/*package*/ GHTag wrap(GHRepository owner) { this.owner = owner; this.root = owner.root; if (commit!=null) commit.wrapUp(owner); return this; }
/*package*/ GHTag wrap(GHRepository owner) { this.owner = owner; this.root = owner.root; if (commit!=null) commit.wrapUp(owner); return this; }
@Override /*package*/ GHCommit[] getItems(GitHub root) { for (GHCommit commit : items) { String repoName = getRepoName(commit.url); try { GHRepository repo = root.getRepository(repoName); commit.wrapUp(repo); } catch (IOException ioe) {} } return items; } }
@Override /*package*/ GHCommit[] getItems(GitHub root) { for (GHCommit commit : items) { String repoName = getRepoName(commit.url); try { GHRepository repo = root.getRepository(repoName); commit.wrapUp(repo); } catch (IOException ioe) {} } return items; } }
/** * Gets a commit object in this repository. */ public GHCommit getCommit(String sha1) throws IOException { GHCommit c = commits.get(sha1); if (c==null) { c = root.retrieve().to(String.format("/repos/%s/%s/commits/%s", owner.login, name, sha1), GHCommit.class).wrapUp(this); commits.put(sha1,c); } return c; }
/** * Gets a commit object in this repository. */ public GHCommit getCommit(String sha1) throws IOException { GHCommit c = commits.get(sha1); if (c==null) { c = root.retrieve().to(String.format("/repos/%s/%s/commits/%s", getOwnerName(), name, sha1), GHCommit.class).wrapUp(this); commits.put(sha1,c); } return c; }
/** * Gets a commit object in this repository. */ public GHCommit getCommit(String sha1) throws IOException { GHCommit c = commits.get(sha1); if (c==null) { c = root.retrieve().to(String.format("/repos/%s/%s/commits/%s", getOwnerName(), name, sha1), GHCommit.class).wrapUp(this); commits.put(sha1,c); } return c; }
/** * Creates a blob based on the parameters specified thus far. */ public GHCommit create() throws IOException { req._with("parents", parents); return req.method("POST").to(getApiTail(), GHCommit.class).wrapUp(repo); } }
/** * Creates a blob based on the parameters specified thus far. */ public GHCommit create() throws IOException { req._with("parents", parents); return req.method("POST").to(getApiTail(), GHCommit.class).wrapUp(repo); } }
/** * Commits a new content. */ public GHContentUpdateResponse commit() throws IOException { GHContentUpdateResponse response = req.to(repo.getApiTailUrl("contents/" + path), GHContentUpdateResponse.class); response.getContent().wrap(repo); response.getCommit().wrapUp(repo); return response; } }
/** * Commits a new content. */ public GHContentUpdateResponse commit() throws IOException { GHContentUpdateResponse response = req.to(repo.getApiTailUrl("contents/" + path), GHContentUpdateResponse.class); response.getContent().wrap(repo); response.getCommit().wrapUp(repo); return response; } }
public GHContentUpdateResponse createContent(byte[] contentBytes, String commitMessage, String path, String branch) throws IOException { Requester requester = new Requester(root) .with("path", path) .with("message", commitMessage) .with("content", DatatypeConverter.printBase64Binary(contentBytes)) .method("PUT"); if (branch != null) { requester.with("branch", branch); } GHContentUpdateResponse response = requester.to(getApiTailUrl("contents/" + path), GHContentUpdateResponse.class); response.getContent().wrap(this); response.getCommit().wrapUp(this); 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 = 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 = 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; }