Interface Contents


@Immutable public interface Contents
GitHub contents.
Since:
0.8
See Also:
Suppressed Checkstyle violations:
MultipleStringLiteralsCheck (500 lines)
  • Method Details

    • repo

      Repo repo()
      Owner of them.
      Returns:
      Repo
    • readme

      Content readme() throws IOException
      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

      Content readme(String branch) throws IOException
      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

      Content create(jakarta.json.JsonObject content) throws IOException
      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

      Content get(String path, String ref) throws IOException
      Get the contents of a single file or symbolic link in a repository.
      Parameters:
      path - The content path
      ref - The name of the commit/branch/tag.
      Returns:
      Content fetched
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • get

      Content get(String path) throws IOException
      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

      Iterable<Content> iterate(String path, String ref) throws IOException
      Get the contents of a directory in a repository.
      Parameters:
      path - The content path
      ref - Commit/branch/tag name
      Returns:
      Contents fetched
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • remove

      RepoCommit remove(jakarta.json.JsonObject content) throws IOException
      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

      RepoCommit update(String path, jakarta.json.JsonObject json) throws IOException
      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

      boolean exists(String path, String ref) throws IOException
      Check whether content exists or not.
      Parameters:
      path - The content path
      ref - The name of the commit/branch/tag.
      Returns:
      True if content exists, false otherwise.
      Throws:
      IOException - If there is any I/O problem