public class GHContent extends Object
GHRepository.getFileContent(String)| Constructor and Description |
|---|
GHContent() |
| Modifier and Type | Method and Description |
|---|---|
GHContentUpdateResponse |
delete(String message) |
GHContentUpdateResponse |
delete(String commitMessage,
String branch) |
String |
getContent()
Deprecated.
Use
read() |
String |
getDownloadUrl()
URL to retrieve the raw content of the file.
|
String |
getEncodedContent()
Deprecated.
Use
read() |
String |
getEncoding() |
String |
getGitUrl() |
String |
getHtmlUrl() |
String |
getName() |
GHRepository |
getOwner() |
String |
getPath() |
String |
getSha() |
long |
getSize() |
String |
getType() |
String |
getUrl() |
boolean |
isDirectory() |
boolean |
isFile() |
PagedIterable<GHContent> |
listDirectoryContent()
List immediate children of this directory.
|
protected void |
populate()
Fully populate the data by retrieving missing data.
|
InputStream |
read()
Retrieves the actual content stored here.
|
GHContentUpdateResponse |
update(byte[] newContentBytes,
String commitMessage) |
GHContentUpdateResponse |
update(byte[] newContentBytes,
String commitMessage,
String branch) |
GHContentUpdateResponse |
update(String newContent,
String commitMessage) |
GHContentUpdateResponse |
update(String newContent,
String commitMessage,
String branch) |
static GHContent[] |
wrap(GHContent[] contents,
GHRepository repository) |
public GHRepository getOwner()
public String getType()
public String getEncoding()
public long getSize()
public String getSha()
public String getName()
public String getPath()
public String getContent() throws IOException
read()Due to the nature of GitHub's API, you're not guaranteed that the content will already be populated, so this may trigger network activity, and can throw an IOException.
IOExceptionpublic String getEncodedContent() throws IOException
read()Due to the nature of GitHub's API, you're not guaranteed that the content will already be populated, so this may trigger network activity, and can throw an IOException.
IOExceptionpublic String getUrl()
public String getGitUrl()
public String getHtmlUrl()
public InputStream read() throws IOException
IOExceptionpublic String getDownloadUrl() throws IOException
IOExceptionpublic boolean isFile()
public boolean isDirectory()
protected void populate()
throws IOException
IOExceptionpublic PagedIterable<GHContent> listDirectoryContent() throws IOException
IOExceptionpublic GHContentUpdateResponse update(String newContent, String commitMessage) throws IOException
IOExceptionpublic GHContentUpdateResponse update(String newContent, String commitMessage, String branch) throws IOException
IOExceptionpublic GHContentUpdateResponse update(byte[] newContentBytes, String commitMessage) throws IOException
IOExceptionpublic GHContentUpdateResponse update(byte[] newContentBytes, String commitMessage, String branch) throws IOException
IOExceptionpublic GHContentUpdateResponse delete(String message) throws IOException
IOExceptionpublic GHContentUpdateResponse delete(String commitMessage, String branch) throws IOException
IOExceptionpublic static GHContent[] wrap(GHContent[] contents, GHRepository repository)
Copyright © 2016. All Rights Reserved.