Package org.kohsuke.github
Class GHContentBuilder
- java.lang.Object
-
- org.kohsuke.github.GHContentBuilder
-
public final class GHContentBuilder extends Object
Used to create/update content.Call various methods to build up parameters, then call
commit()
to make the change effective.- Author:
- Kohsuke Kawaguchi
- See Also:
GHRepository#createContent()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GHContentBuilder
branch(String branch)
Branch gh content builder.GHContentUpdateResponse
commit()
Commits a new content.GHContentBuilder
content(byte[] content)
Content gh content builder.GHContentBuilder
content(String content)
Content gh content builder.GHContentBuilder
message(String commitMessage)
Message gh content builder.GHContentBuilder
path(String path)
Path gh content builder.GHContentBuilder
sha(String sha)
Used when updating (but not creating a new content) to specify the blob SHA of the file being replaced.
-
-
-
Method Detail
-
path
public GHContentBuilder path(String path)
Path gh content builder.- Parameters:
path
- the path- Returns:
- the gh content builder
-
branch
public GHContentBuilder branch(String branch)
Branch gh content builder.- Parameters:
branch
- the branch- Returns:
- the gh content builder
-
sha
public GHContentBuilder sha(String sha)
Used when updating (but not creating a new content) to specify the blob SHA of the file being replaced.- Parameters:
sha
- the sha- Returns:
- the gh content builder
-
content
public GHContentBuilder content(byte[] content)
Content gh content builder.- Parameters:
content
- the content- Returns:
- the gh content builder
-
content
public GHContentBuilder content(String content)
Content gh content builder.- Parameters:
content
- the content- Returns:
- the gh content builder
-
message
public GHContentBuilder message(String commitMessage)
Message gh content builder.- Parameters:
commitMessage
- the commit message- Returns:
- the gh content builder
-
commit
public GHContentUpdateResponse commit() throws IOException
Commits a new content.- Returns:
- the gh content update response
- Throws:
IOException
- the io exception
-
-