Interface Contents


  • @Immutable
    public interface Contents
    Github contents.
    Since:
    0.8
    Version:
    $Id: a7c0f7abd912950657e20838108bd8eaf1377810 $
    Author:
    Andres Candal (andres.candal@rollasolution.com)
    See Also:
    Contents API
    Suppressed Checkstyle violations:
    MultipleStringLiteralsCheck (500 lines)
    • Method Detail

      • 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:
        Get the README
      • 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:
        Get the README
      • create

        Content create​(javax.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:
        Create a file
      • 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 contents
      • 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:
        Get contents
      • 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 - The name of the commit/branch/tag. Default: the repository's default branch (usually master)
        Returns:
        Contents fetched
        Throws:
        IOException - If there is any I/O problem
        See Also:
        Get contents
      • remove

        RepoCommit remove​(javax.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:
        Delete a file
      • update

        RepoCommit update​(String path,
                          javax.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:
        Update a file
      • 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