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 intcompareTo(Content cont)Stringcontent()Get its encoded content.byte[]decoded()Get its decoded content.URLgitUrl()Get its GIT URL.URLhtmlUrl()Get its HTML URL.javax.json.JsonObjectjson()Describe it in a JSON object.Stringname()Get its name.voidpatch(javax.json.JsonObject json)Patch using this JSON object.Stringpath()Get its path name.InputStreamraw()Get the raw contents.Reporepo()Repository we're in.Stringsha()Get its sha hash.intsize()Get its size.Stringtype()Get its type.URLurl()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 IOExceptionGet 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 IOExceptionGet its decoded content.- Returns:
- Decoded content
- Throws:
IOException- If there is any I/O problem
-
compareTo
public int compareTo(Content cont)
- Specified by:
compareToin interfaceComparable<Content>
-
patch
public void patch(javax.json.JsonObject json) throws IOExceptionDescription copied from interface:JsonPatchablePatch using this JSON object.- Specified by:
patchin interfaceJsonPatchable- Parameters:
json- JSON object- Throws:
IOException- If there is any I/O problem
-
json
public javax.json.JsonObject json() throws IOExceptionDescription copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
- Throws:
IOException- If there is any I/O problem
-
raw
public InputStream raw() throws IOException
Description copied from interface:ContentGet the raw contents.- Specified by:
rawin interfaceContent- Returns:
- Input stream of the raw content
- Throws:
IOException- If an IO error occurs
-
-