Package org.kohsuke.github
Class GHTreeEntry
- java.lang.Object
-
- org.kohsuke.github.GHTreeEntry
-
-
Constructor Summary
Constructors Constructor Description GHTreeEntry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GHBlob
asBlob()
If this tree entry represents a file, then return its information.GHTree
asTree()
If this tree entry represents a directory, then return it.String
getMode()
Get mode such as 100644String
getPath()
Get the path such as "subdir/file.txt"String
getSha()
SHA1 of this object.long
getSize()
Gets the size of the file, such as 132String
getType()
Gets the type such as: "blob", "tree", etc.URL
getUrl()
API URL to this Git data, such as https://api.github.com/repos/jenkinsci /jenkins/git/commits/b72322675eb0114363a9a86e9ad5a170d1d07ac0InputStream
readAsBlob()
If this tree entry represents a file, then return its content.
-
-
-
Method Detail
-
getPath
public String getPath()
Get the path such as "subdir/file.txt"- Returns:
- the path
-
getMode
public String getMode()
Get mode such as 100644- Returns:
- the mode
-
getSize
public long getSize()
Gets the size of the file, such as 132- Returns:
- The size of the path or 0 if it is a directory
-
getType
public String getType()
Gets the type such as: "blob", "tree", etc.- Returns:
- The type
-
getSha
public String getSha()
SHA1 of this object.- Returns:
- the sha
-
getUrl
public URL getUrl()
API URL to this Git data, such as https://api.github.com/repos/jenkinsci /jenkins/git/commits/b72322675eb0114363a9a86e9ad5a170d1d07ac0- Returns:
- the url
-
asBlob
public GHBlob asBlob() throws IOException
If this tree entry represents a file, then return its information. Otherwise null.- Returns:
- the gh blob
- Throws:
IOException
- the io exception
-
readAsBlob
public InputStream readAsBlob() throws IOException
If this tree entry represents a file, then return its content. Otherwise null.- Returns:
- the input stream
- Throws:
IOException
- the io exception
-
asTree
public GHTree asTree() throws IOException
If this tree entry represents a directory, then return it. Otherwise null.- Returns:
- the gh tree
- Throws:
IOException
- the io exception
-
-