Class Hooks


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

      Constructors 
      Constructor Description
      Hooks()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CommitMsgHook commitMsg​(Repository repo, java.io.PrintStream outputStream)
      Create commit-msg hook for the given repository with the default error stream
      static CommitMsgHook commitMsg​(Repository repo, java.io.PrintStream outputStream, java.io.PrintStream errorStream)
      Create commit-msg hook for the given repository
      static PostCommitHook postCommit​(Repository repo, java.io.PrintStream outputStream)
      Create post-commit hook for the given repository with the default error stream
      static PostCommitHook postCommit​(Repository repo, java.io.PrintStream outputStream, java.io.PrintStream errorStream)
      Create post-commit hook for the given repository
      static PreCommitHook preCommit​(Repository repo, java.io.PrintStream outputStream)
      Create pre-commit hook for the given repository with the default error stream
      static PreCommitHook preCommit​(Repository repo, java.io.PrintStream outputStream, java.io.PrintStream errorStream)
      Create pre-commit hook for the given repository
      static PrePushHook prePush​(Repository repo, java.io.PrintStream outputStream)
      Create pre-push hook for the given repository with the default error stream
      static PrePushHook prePush​(Repository repo, java.io.PrintStream outputStream, java.io.PrintStream errorStream)
      Create pre-push hook for the given repository
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Hooks

        public Hooks()
    • Method Detail

      • preCommit

        public static PreCommitHook preCommit​(Repository repo,
                                              java.io.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,
                                              java.io.PrintStream outputStream,
                                              java.io.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,
                                                java.io.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,
                                                java.io.PrintStream outputStream,
                                                java.io.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,
                                              java.io.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,
                                              java.io.PrintStream outputStream,
                                              java.io.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,
                                          java.io.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,
                                          java.io.PrintStream outputStream,
                                          java.io.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