public static GHContent[] wrap(GHContent[] contents, GHRepository repository) { for (GHContent unwrappedContent : contents) { unwrappedContent.wrap(repository); } return contents; } }
@Override /*package*/ GHContent[] getItems(GitHub root) { for (GHContent item : items) item.wrap(root); return items; } }
@Override /*package*/ GHContent[] getItems(GitHub root) { for (GHContent item : items) item.wrap(root); return items; } }
@Override /*package*/ GHContent[] getItems(GitHub root) { for (GHContent item : items) item.wrap(root); return items; } }
public static GHContent[] wrap(GHContent[] contents, GHRepository repository) { for (GHContent unwrappedContent : contents) { unwrappedContent.wrap(repository); } return contents; } }
public static GHContent[] wrap(GHContent[] contents, GHRepository repository) { for (GHContent unwrappedContent : contents) { unwrappedContent.wrap(repository); } return contents; } }
@Override GHContentWithLicense wrap(GHRepository owner) { super.wrap(owner); if (license!=null) license.wrap(owner.root); return this; } }
@Override GHContentWithLicense wrap(GHRepository owner) { super.wrap(owner); if (license!=null) license.wrap(owner.root); return this; } }
public List<GHContent> getDirectoryContent(String path, String ref) throws IOException { Requester requester = root.retrieve(); while (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } String target = getApiTailUrl("contents/" + path); GHContent[] files = requester.with("ref",ref).to(target, GHContent[].class); GHContent.wrap(files, this); return Arrays.asList(files); }
public List<GHContent> getDirectoryContent(String path, String ref) throws IOException { Requester requester = root.retrieve(); while (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } String target = getApiTailUrl("contents/" + path); GHContent[] files = requester.with("ref",ref).to(target, GHContent[].class); GHContent.wrap(files, this); return Arrays.asList(files); }
/** * https://developer.github.com/v3/repos/contents/#get-the-readme */ public GHContent getReadme() throws IOException { Requester requester = root.retrieve(); return requester.to(getApiTailUrl("readme"), GHContent.class).wrap(this); }
/** * https://developer.github.com/v3/repos/contents/#get-the-readme */ public GHContent getReadme() throws IOException { Requester requester = root.retrieve(); return requester.to(getApiTailUrl("readme"), GHContent.class).wrap(this); }
public List<GHContent> getDirectoryContent(String path, String ref) throws IOException { Requester requester = root.retrieve(); String target = getApiTailUrl("contents/" + path); GHContent[] files = requester.with("ref",ref).to(target, GHContent[].class); GHContent.wrap(files, this); return Arrays.asList(files); }
/** * https://developer.github.com/v3/repos/contents/#get-the-readme */ public GHContent getReadme() throws IOException { Requester requester = root.retrieve(); return requester.to(getApiTailUrl("readme"), GHContent.class).wrap(this); }
public GHContent getFileContent(String path, String ref) throws IOException { Requester requester = root.retrieve(); String target = getApiTailUrl("contents/" + path); return requester.with("ref",ref).to(target, GHContent.class).wrap(this); }
public GHContent getFileContent(String path, String ref) throws IOException { Requester requester = root.retrieve(); String target = getApiTailUrl("contents/" + path); return requester.with("ref",ref).to(target, GHContent.class).wrap(this); }
public GHContent getFileContent(String path, String ref) throws IOException { Requester requester = root.retrieve(); String target = getApiTailUrl("contents/" + path); return requester.with("ref",ref).to(target, GHContent.class).wrap(this); }
/** * 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; }