org.kohsuke.github
Class GHContent

java.lang.Object
  extended by org.kohsuke.github.GHContent

public class GHContent
extends Object

A Content of a repository.

Author:
Alexandre COLLIGNON
See Also:
GHRepository.getFileContent(String)

Constructor Summary
GHContent()
           
 
Method Summary
 GHContentUpdateResponse delete(String message)
           
 GHContentUpdateResponse delete(String commitMessage, String branch)
           
 String getContent()
          Retrieve the decoded content that is stored at this location.
 String getEncodedContent()
          Retrieve the raw content that is stored at this location.
 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.
 GHContentUpdateResponse update(String newContent, String commitMessage)
           
 GHContentUpdateResponse update(String newContent, String commitMessage, String branch)
           
static GHContent[] wrap(GHContent[] contents, GHRepository repository)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GHContent

public GHContent()
Method Detail

getOwner

public GHRepository getOwner()

getType

public String getType()

getEncoding

public String getEncoding()

getSize

public long getSize()

getSha

public String getSha()

getName

public String getName()

getPath

public String getPath()

getContent

public String getContent()
                  throws IOException
Retrieve the decoded content that is stored at this location. 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.

Throws:
IOException

getEncodedContent

public String getEncodedContent()
                         throws IOException
Retrieve the raw content that is stored at this location. 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.

Throws:
IOException

getUrl

public String getUrl()

getGitUrl

public String getGitUrl()

getHtmlUrl

public String getHtmlUrl()

isFile

public boolean isFile()

isDirectory

public boolean isDirectory()

listDirectoryContent

public PagedIterable<GHContent> listDirectoryContent()
                                              throws IOException
List immediate children of this directory.

Throws:
IOException

update

public GHContentUpdateResponse update(String newContent,
                                      String commitMessage)
                               throws IOException
Throws:
IOException

update

public GHContentUpdateResponse update(String newContent,
                                      String commitMessage,
                                      String branch)
                               throws IOException
Throws:
IOException

delete

public GHContentUpdateResponse delete(String message)
                               throws IOException
Throws:
IOException

delete

public GHContentUpdateResponse delete(String commitMessage,
                                      String branch)
                               throws IOException
Throws:
IOException

wrap

public static GHContent[] wrap(GHContent[] contents,
                               GHRepository repository)


Copyright © 2014. All rights reserved.