Package com.jcabi.github
Interface Contents
@Immutable
public interface Contents
GitHub contents.
- Since:
- 0.8
- See Also:
- Suppressed Checkstyle violations:
- MultipleStringLiteralsCheck (500 lines)
-
Method Summary
Modifier and TypeMethodDescriptioncreate(jakarta.json.JsonObject content) Create new file.booleanCheck whether content exists or not.Get the contents of a single file or symbolic link.Get the contents of a single file or symbolic link in a repository.Get the contents of a directory in a repository.readme()Get the Readme file of the default branch (usually master).Get the Readme file of the specified branch.remove(jakarta.json.JsonObject content) Removes a file.repo()Owner of them.Updates a file.
-
Method Details
-
repo
Repo repo()Owner of them.- Returns:
- Repo
-
readme
Get the Readme file of the default branch (usually master).- Returns:
- The Content of the readme file.
- Throws:
IOException- If an IO Exception occurs.- See Also:
-
readme
Get the Readme file of the specified branch.- Parameters:
branch- The branch name- Returns:
- The Content of the readme file.
- Throws:
IOException- If an IO Exception occurs.- See Also:
-
create
Create new file.- Parameters:
content- Parameters to create new content- Returns:
- Content just created
- Throws:
IOException- If there is any I/O problem- See Also:
-
get
Get the contents of a single file or symbolic link in a repository.- Parameters:
path- The content pathref- The name of the commit/branch/tag.- Returns:
- Content fetched
- Throws:
IOException- If there is any I/O problem- See Also:
-
get
Get the contents of a single file or symbolic link. in a repository's default branch (usually master).- Parameters:
path- The content path- Returns:
- Content fetched
- Throws:
IOException- If there is any I/O problem- See Also:
-
iterate
Get the contents of a directory in a repository.- Parameters:
path- The content pathref- Commit/branch/tag name- Returns:
- Contents fetched
- Throws:
IOException- If there is any I/O problem- See Also:
-
remove
Removes a file.- Parameters:
content- Parameters to remove a file- Returns:
- RepoCommit referring to this operation
- Throws:
IOException- If there is any I/O problem- See Also:
-
update
Updates a file.- Parameters:
path- The content path.json- JSON object containing updates to the content.- Returns:
- Commit referring to this operation
- Throws:
IOException- If any I/O problems occur.- See Also:
-
exists
Check whether content exists or not.- Parameters:
path- The content pathref- The name of the commit/branch/tag.- Returns:
- True if content exists, false otherwise.
- Throws:
IOException- If there is any I/O problem
-