Package org.kohsuke.github
Class GHTreeBuilder
java.lang.Object
org.kohsuke.github.GHTreeBuilder
Builder pattern for creating a new tree. Based on https://developer.github.com/v3/git/trees/#create-a-tree
-
Method Summary
Modifier and TypeMethodDescriptionAdds a new entry with the given binary content to the tree.Adds a new entry with the given text content to the tree.Base tree gh tree builder.create()
Creates a tree based on the parameters specified thus far.Removes an entry with the given path from base tree.Deprecated.Deprecated.useadd(String, String, boolean)
oradd(String, byte[], boolean)
instead.Deprecated.useadd(String, String, boolean)
oradd(String, byte[], boolean)
instead.
-
Method Details
-
baseTree
Base tree gh tree builder.- Parameters:
baseTree
- the SHA of tree you want to update with new data- Returns:
- the gh tree builder
-
entry
@Deprecated public GHTreeBuilder entry(String path, String mode, String type, String sha, String content) Deprecated.useadd(String, String, boolean)
oradd(String, byte[], boolean)
instead.Adds a new entry to the tree. Exactly one of the parameterssha
andcontent
must be non-null.- Parameters:
path
- the pathmode
- the modetype
- the typesha
- the shacontent
- the content- Returns:
- the gh tree builder
-
shaEntry
Deprecated.useadd(String, String, boolean)
oradd(String, byte[], boolean)
instead.Specialized version ofentry(String, String, String, String, String)
for adding an existing blob referred by its SHA.- Parameters:
path
- the pathsha
- the shaexecutable
- the executable- Returns:
- the gh tree builder
-
textEntry
Deprecated.useadd(String, String, boolean)
oradd(String, byte[], boolean)
instead.Specialized version ofentry(String, String, String, String, String)
for adding a text file with the specifiedcontent
.- Parameters:
path
- the pathcontent
- the contentexecutable
- the executable- Returns:
- the gh tree builder
-
add
Adds a new entry with the given binary content to the tree.- Parameters:
path
- the file path in the treecontent
- the file content as byte arrayexecutable
- true, if the file should be executable- Returns:
- this GHTreeBuilder
-
add
Adds a new entry with the given text content to the tree.- Parameters:
path
- the file path in the treecontent
- the file content as UTF-8 encoded stringexecutable
- true, if the file should be executable- Returns:
- this GHTreeBuilder
-
delete
Removes an entry with the given path from base tree.- Parameters:
path
- the file path in the tree- Returns:
- this GHTreeBuilder
-
create
Creates a tree based on the parameters specified thus far.- Returns:
- the gh tree
- Throws:
IOException
- the io exception
-
add(String, String, boolean)
oradd(String, byte[], boolean)
instead.