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
Smart Content with extra features.
- Since:
- 0.8
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.github.Content
Content.Smart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcontent()Get its encoded content.byte[]decoded()Get its decoded content.gitUrl()Get its GIT URL.htmlUrl()Get its HTML URL.jakarta.json.JsonObjectjson()Describe it in a JSON object.name()Get its name.voidpatch(jakarta.json.JsonObject json) Patch using this JSON object.path()Get its path name.raw()Get the raw contents.repo()Repository we're in.sha()Get its sha hash.intsize()Get its size.type()Get its type.url()Get its URL.
-
Constructor Details
-
Smart
Public ctor.- Parameters:
cont- Content
-
-
Method Details
-
name
Get its name.- Returns:
- Name of content
- Throws:
IOException- If there is any I/O problem
-
type
Get its type.- Returns:
- Type of content
- Throws:
IOException- If there is any I/O problem
-
size
Get its size.- Returns:
- Size content
- Throws:
IOException- If it fails
-
sha
Get its sha hash.- Returns:
- Sha hash of content
- Throws:
IOException- If there is any I/O problem
-
url
Get its URL.- Returns:
- URL of content
- Throws:
IOException- If there is any I/O problem
-
htmlUrl
Get its HTML URL.- Returns:
- URL of content
- Throws:
IOException- If there is any I/O problem
-
gitUrl
Get its GIT URL.- Returns:
- URL of content
- Throws:
IOException- If there is any I/O problem
-
content
Get its encoded content.- Returns:
- Base64 encoded content
- Throws:
IOException- If there is any I/O problem
-
decoded
Get its decoded content.- Returns:
- Decoded content
- Throws:
IOException- If there is any I/O problem
-
compareTo
- Specified by:
compareToin interfaceComparable<Content>
-
patch
Description 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
Description 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
-
repo
Description copied from interface:ContentRepository we're in. -
path
Description copied from interface:ContentGet its path name. -
raw
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
-