Package com.jcabi.github
Class Gist.Smart
- java.lang.Object
-
- com.jcabi.github.Gist.Smart
-
- All Implemented Interfaces:
Gist,JsonPatchable,JsonReadable
- Enclosing interface:
- Gist
@Immutable @Loggable(1) public static final class Gist.Smart extends Object implements Gist
Smart Gist with extra features.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Gist
Gist.Smart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GistCommentscomments()Get all comments of the gist.Iterable<String>files()Get a list of all file names in the gist.Gistfork()Fork the gist.Githubgithub()Github we're in.Stringidentifier()Get gist id.javax.json.JsonObjectjson()Describe it in a JSON object.voidpatch(javax.json.JsonObject json)Patch using this JSON object.Stringread(String name)Read file content.voidstar()Star a gist.booleanstarred()Checks if Gist is starred.voidunstar()Unstar a gist.voidwrite(String name, String content)Write file content.
-
-
-
Constructor Detail
-
Smart
public Smart(Gist gst)
Public ctor.- Parameters:
gst- Gist
-
-
Method Detail
-
identifier
public String identifier()
Get gist id.- Specified by:
identifierin interfaceGist- Returns:
- Gist id
-
files
public Iterable<String> files() throws IOException
Get a list of all file names in the gist.- Returns:
- File names
- Throws:
IOException- If there is any I/O problem
-
read
public String read(String name) throws IOException
Description copied from interface:GistRead file content.- Specified by:
readin interfaceGist- Parameters:
name- Name of it- Returns:
- File content
- Throws:
IOException- If there is any I/O problem- See Also:
- Get a Single Gist
-
write
public void write(String name, String content) throws IOException
Description copied from interface:GistWrite file content.- Specified by:
writein interfaceGist- Parameters:
name- Name of itcontent- Content to write- Throws:
IOException- If there is any I/O problem- See Also:
- Edit a Gist
-
star
public void star() throws IOExceptionDescription copied from interface:GistStar a gist.- Specified by:
starin interfaceGist- Throws:
IOException- If there is any I/O problem
-
unstar
public void unstar() throws IOExceptionDescription copied from interface:GistUnstar a gist.- Specified by:
unstarin interfaceGist- Throws:
IOException- If there is any I/O problem
-
starred
public boolean starred() throws IOExceptionDescription copied from interface:GistChecks if Gist is starred.- Specified by:
starredin interfaceGist- Returns:
- True if gist is starred
- Throws:
IOException- If there is any I/O problem
-
fork
public Gist fork() throws IOException
Description copied from interface:GistFork the gist.- Specified by:
forkin interfaceGist- Returns:
- Forked gist
- Throws:
IOException- If there is any I/O problem
-
comments
public GistComments comments() throws IOException
Description copied from interface:GistGet all comments of the gist.- Specified by:
commentsin interfaceGist- Returns:
- GistComments
- Throws:
IOException- If there is any I/O problem- See Also:
- Gist Comments API
-
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
-
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
-
-