Interface GitLocationResolver


  • public interface GitLocationResolver
    Used by the GIT command(s) to resolve the root directory of the GIT repository
    • Method Detail

      • resolveRootDirectory

        java.nio.file.Path resolveRootDirectory​(java.lang.String command,
                                                java.lang.String[] args,
                                                org.apache.sshd.server.session.ServerSession session,
                                                java.nio.file.FileSystem fs)
                                         throws java.io.IOException
        Parameters:
        command - The complete received command
        args - The command split into arguments - args[0] is the "pure" command itself without any other arguments. Note: changing the content of the arguments array may affect command execution in undetermined ways, due to invocation code changes without prior notice, so highly recommended to avoid it.
        session - The ServerSession through which the command was received
        fs - The FileSystem associated with the server session
        Returns:
        The local GIT repository root path
        Throws:
        java.io.IOException - If failed to resolve
      • constantPath

        static GitLocationResolver constantPath​(java.nio.file.Path rootDir)
        Creates a resolver that returns the same root directory for any invocation of resolveRootDirectory
        Parameters:
        rootDir - The (never null) root directory to return
        Returns:
        The wrapper resolver