call()
| Modifier and Type | Field and Description |
|---|---|
| private final OutputStream | errorStream
The error stream to be used by the hook. |
| private final OutputStream | outputStream
The output stream to be used by the hook. |
| private final Repository |
| Access | Constructor and Description |
|---|---|
| protected | GitHook(Repository
a repo, OutputStream org. object.The output stream the hook must use. outputStream)null is allowed,
in which case the hook will use System.out.Constructor for GitHook. |
| protected | GitHook(Repository
a repo, OutputStream org. object.The output stream the hook must use. outputStream, OutputStream null is allowed,
in which case the hook will use System.out.The error stream the hook must use. errorStream)null is allowed,
in which case the hook will use System.err.Constructor for GitHook |
| Modifier and Type | Method and Description |
|---|---|
| public abstract T | call()
Redeclares java. Computes a result, or throws an exception if unable to do so. |
| protected void | |
| protected OutputStream | Returns: The error stream the hook must use. Nevernull,
System.err is returned by default.Get error stream |
| public abstract String | |
| protected OutputStream | Returns: The output stream the hook must use. Nevernull,
System.out is returned by default.Get output stream |
| protected String[] | Returns: The parameters the hook receives.Override this method when needed to provide relevant parameters to the underlying hook script. |
| protected Repository | |
| protected String | Returns: The parameters the hook receives.Override to provide relevant arguments via stdin to the underlying hook script. |
| protected void | handleError(String
error message message, final ProcessResult The process result of the hook result)Process that the hook exited with an error. |
| public boolean | Returns: whether a native hook script is installed in the repository.Check whether a 'native' (i.e. script) hook is installed in the repository. |
| errorStream | back to summary |
|---|---|
| private final OutputStream errorStream The error stream to be used by the hook. | |
| outputStream | back to summary |
|---|---|
| private final OutputStream outputStream The output stream to be used by the hook. | |
| repo | back to summary |
|---|---|
| private final Repository repo | |
| GitHook | back to summary |
|---|---|
| protected GitHook(Repository repo, OutputStream outputStream) Constructor for GitHook. This constructor will use stderr for the error stream.
| |
| GitHook | back to summary |
|---|---|
| protected GitHook(Repository repo, OutputStream outputStream, OutputStream errorStream) Constructor for GitHook
| |
| call | back to summary |
|---|---|
| public abstract T call() throws IOException, AbortedByHookException Redeclares java. Doc from java. Computes a result, or throws an exception if unable to do so. Run the hook.
| |
| doRun | back to summary |
|---|---|
| protected void doRun() throws AbortedByHookException, IOException Runs the hook, without performing any validity checks.
| |
| getErrorStream | back to summary |
|---|---|
| protected OutputStream getErrorStream() Get error stream
| |
| getHookName | back to summary |
|---|---|
| public abstract String getHookName() Get name of the hook
| |
| getOutputStream | back to summary |
|---|---|
| protected OutputStream getOutputStream() Get output stream
| |
| getParameters | back to summary |
|---|---|
| protected String[] getParameters() Override this method when needed to provide relevant parameters to the underlying hook script. The default implementation returns an empty array.
| |
| getRepository | back to summary |
|---|---|
| protected Repository getRepository() Get the repository
| |
| getStdinArgs | back to summary |
|---|---|
| protected String getStdinArgs() Override to provide relevant arguments via stdin to the underlying hook
script. The default implementation returns
| |
| handleError | back to summary |
|---|---|
| protected void handleError(String message, final ProcessResult result) throws AbortedByHookException Process that the hook exited with an error. This default implementation
throws an
| |
| isNativeHookPresent | back to summary |
|---|---|
| public boolean isNativeHookPresent() Check whether a 'native' (i.e. script) hook is installed in the repository.
| |