Class Content.Smart

java.lang.Object
com.jcabi.github.Content.Smart
All Implemented Interfaces:
Content, JsonPatchable, JsonReadable, Comparable<Content>
Enclosing interface:
Content

@Immutable @Loggable(1) public static final class Content.Smart extends Object implements Content
Smart Content with extra features.
Since:
0.8
  • Constructor Details

    • Smart

      public Smart(Content cont)
      Public ctor.
      Parameters:
      cont - Content
  • Method Details

    • name

      public String name() throws IOException
      Get its name.
      Returns:
      Name of content
      Throws:
      IOException - If there is any I/O problem
    • type

      public String type() throws IOException
      Get its type.
      Returns:
      Type of content
      Throws:
      IOException - If there is any I/O problem
    • size

      public int size() throws IOException
      Get its size.
      Returns:
      Size content
      Throws:
      IOException - If it fails
    • sha

      public String sha() throws IOException
      Get its sha hash.
      Returns:
      Sha hash of content
      Throws:
      IOException - If there is any I/O problem
    • url

      public URL url() throws IOException
      Get its URL.
      Returns:
      URL of content
      Throws:
      IOException - If there is any I/O problem
    • htmlUrl

      public URL htmlUrl() throws IOException
      Get its HTML URL.
      Returns:
      URL of content
      Throws:
      IOException - If there is any I/O problem
    • gitUrl

      public URL gitUrl() throws IOException
      Get its GIT URL.
      Returns:
      URL of content
      Throws:
      IOException - If there is any I/O problem
    • content

      public String content() throws IOException
      Get its encoded content.
      Returns:
      Base64 encoded content
      Throws:
      IOException - If there is any I/O problem
    • decoded

      public byte[] decoded() throws IOException
      Get its decoded content.
      Returns:
      Decoded content
      Throws:
      IOException - If there is any I/O problem
    • compareTo

      public int compareTo(Content cont)
      Specified by:
      compareTo in interface Comparable<Content>
    • patch

      public void patch(jakarta.json.JsonObject json) throws IOException
      Description copied from interface: JsonPatchable
      Patch using this JSON object.
      Specified by:
      patch in interface JsonPatchable
      Parameters:
      json - JSON object
      Throws:
      IOException - If there is any I/O problem
    • json

      public jakarta.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
    • repo

      public Repo repo()
      Description copied from interface: Content
      Repository we're in.
      Specified by:
      repo in interface Content
      Returns:
      Repo
    • path

      public String path()
      Description copied from interface: Content
      Get its path name.
      Specified by:
      path in interface Content
      Returns:
      The path name
    • raw

      public InputStream raw() throws IOException
      Description copied from interface: Content
      Get the raw contents.
      Specified by:
      raw in interface Content
      Returns:
      Input stream of the raw content
      Throws:
      IOException - If an IO error occurs