Class Hooks


  • public class Hooks
    extends Object
    Factory class for instantiating supported hooks.
    Since:
    4.0
    • Constructor Detail

      • Hooks

        public Hooks()
    • Method Detail

      • preCommit

        public static PreCommitHook preCommit​(Repository repo,
                                              PrintStream outputStream)
        Create pre-commit hook for the given repository with the default error stream
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        Returns:
        The pre-commit hook for the given repository.
      • preCommit

        public static PreCommitHook preCommit​(Repository repo,
                                              PrintStream outputStream,
                                              PrintStream errorStream)
        Create pre-commit hook for the given repository
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        errorStream - The error stream, or null to use System.err
        Returns:
        The pre-commit hook for the given repository.
        Since:
        5.6
      • postCommit

        public static PostCommitHook postCommit​(Repository repo,
                                                PrintStream outputStream)
        Create post-commit hook for the given repository with the default error stream
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        Returns:
        The post-commit hook for the given repository.
        Since:
        4.5
      • postCommit

        public static PostCommitHook postCommit​(Repository repo,
                                                PrintStream outputStream,
                                                PrintStream errorStream)
        Create post-commit hook for the given repository
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        errorStream - The error stream, or null to use System.err
        Returns:
        The pre-commit hook for the given repository.
        Since:
        5.6
      • commitMsg

        public static CommitMsgHook commitMsg​(Repository repo,
                                              PrintStream outputStream)
        Create commit-msg hook for the given repository with the default error stream
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        Returns:
        The commit-msg hook for the given repository.
      • commitMsg

        public static CommitMsgHook commitMsg​(Repository repo,
                                              PrintStream outputStream,
                                              PrintStream errorStream)
        Create commit-msg hook for the given repository
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        errorStream - The error stream, or null to use System.err
        Returns:
        The pre-commit hook for the given repository.
        Since:
        5.6
      • prePush

        public static PrePushHook prePush​(Repository repo,
                                          PrintStream outputStream)
        Create pre-push hook for the given repository with the default error stream
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        Returns:
        The pre-push hook for the given repository.
        Since:
        4.2
      • prePush

        public static PrePushHook prePush​(Repository repo,
                                          PrintStream outputStream,
                                          PrintStream errorStream)
        Create pre-push hook for the given repository
        Parameters:
        repo - a Repository object.
        outputStream - The output stream, or null to use System.out
        errorStream - The error stream, or null to use System.err
        Returns:
        The pre-push hook for the given repository.
        Since:
        5.6