Class FileChange.Smart

    • Constructor Detail

      • Smart

        public Smart​(FileChange chng)
        Public ctor.
        Parameters:
        chng - File change
    • Method Detail

      • filename

        public String filename()
                        throws IOException
        File's name. Includes the path to the file from the root directory of the repository. Does not start with a forward slash. Example: "foo/bar/baz.txt"
        Returns:
        Filename
        Throws:
        IOException - If there is any I/O problem
      • additions

        public int additions()
                      throws IOException
        Number of lines added, or 0 if the file is binary.
        Returns:
        Number of lines added
        Throws:
        IOException - If there is any I/O problem
      • deletions

        public int deletions()
                      throws IOException
        Number of lines deleted, or 0 if the file is binary.
        Returns:
        Number of lines deleted
        Throws:
        IOException - If there is any I/O problem
      • patch

        public com.google.common.base.Optional<String> patch()
                                                      throws IOException
        Diff string of the changes to the file. Only available if the file is text (as opposed to binary).
        Returns:
        Diff string
        Throws:
        IOException - If there is any I/O problem
      • rawUrl

        public String rawUrl()
                      throws IOException
        URL for the raw contents of the file.
        Returns:
        URL
        Throws:
        IOException - If there is any I/O problem
      • blobUrl

        public String blobUrl()
                       throws IOException
        URL for the file's git blob.
        Returns:
        URL
        Throws:
        IOException - If there is any I/O problem
      • contentsUrl

        public String contentsUrl()
                           throws IOException
        Repo contents URL for the file.
        Returns:
        URL
        Throws:
        IOException - If there is any I/O problem
      • json

        public javax.json.JsonObject json()
                                   throws IOException
        Description copied from interface: JsonReadable
        Describe it in a JSON object.
        Specified by:
        json in interface JsonReadable
        Returns:
        JSON object
        Throws:
        IOException - If there is any I/O problem