Package com.jcabi.github
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Content
Content.Smart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Content cont)
String
content()
Get its encoded content.byte[]
decoded()
Get its decoded content.URL
gitUrl()
Get its GIT URL.URL
htmlUrl()
Get its HTML URL.javax.json.JsonObject
json()
Describe it in a JSON object.String
name()
Get its name.void
patch(javax.json.JsonObject json)
Patch using this JSON object.String
path()
Get its path name.InputStream
raw()
Get the raw contents.Repo
repo()
Repository we're in.String
sha()
Get its sha hash.int
size()
Get its size.String
type()
Get its type.URL
url()
Get its URL.
-
-
-
Constructor Detail
-
Smart
public Smart(Content cont)
Public ctor.- Parameters:
cont
- Content
-
-
Method Detail
-
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 interfaceComparable<Content>
-
patch
public void patch(javax.json.JsonObject json) throws IOException
Description copied from interface:JsonPatchable
Patch using this JSON object.- Specified by:
patch
in interfaceJsonPatchable
- Parameters:
json
- JSON object- 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 interfaceJsonReadable
- Returns:
- JSON object
- Throws:
IOException
- If there is any I/O problem
-
raw
public InputStream raw() throws IOException
Description copied from interface:Content
Get the raw contents.- Specified by:
raw
in interfaceContent
- Returns:
- Input stream of the raw content
- Throws:
IOException
- If an IO error occurs
-
-