java.lang.Object
org.kohsuke.github.GHTreeEntry
Provides information for Git Trees https://developer.github.com/v3/git/trees/
- Author:
- Daniel Teixeira - https://github.com/ddtxra
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasBlob()
If this tree entry represents a file, then return its information.asTree()
If this tree entry represents a directory, then return it.getMode()
Get mode such as 100644.getPath()
Get the path such as "subdir/file.txt"getSha()
SHA1 of this object.long
getSize()
Gets the size of the file, such as 132.getType()
Gets the type such as: "blob", "tree", etc.getUrl()
API URL to this Git data, such as https://api.github.com/repos/jenkinsci /jenkins/git/commits/b72322675eb0114363a9a86e9ad5a170d1d07ac0If this tree entry represents a file, then return its content.
-
Constructor Details
-
GHTreeEntry
public GHTreeEntry()Create default GHTreeEntry instance
-
-
Method Details
-
getPath
Get the path such as "subdir/file.txt"- Returns:
- the path
-
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
Gets the type such as: "blob", "tree", etc.- Returns:
- The type
-
getSha
SHA1 of this object.- Returns:
- the sha
-
getUrl
API URL to this Git data, such as https://api.github.com/repos/jenkinsci /jenkins/git/commits/b72322675eb0114363a9a86e9ad5a170d1d07ac0- Returns:
- the url
-
asBlob
If this tree entry represents a file, then return its information. Otherwise null.- Returns:
- the gh blob
- Throws:
IOException
- the io exception
-
readAsBlob
If this tree entry represents a file, then return its content. Otherwise null.- Returns:
- the input stream
- Throws:
IOException
- the io exception
-
asTree
If this tree entry represents a directory, then return it. Otherwise null.- Returns:
- the gh tree
- Throws:
IOException
- the io exception
-