Interface GitLocationResolver


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

    • resolveRootDirectory

      Path resolveRootDirectory(String command, String[] args, org.apache.sshd.server.session.ServerSession session, FileSystem fs) throws 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:
      IOException - If failed to resolve
    • constantPath

      static GitLocationResolver constantPath(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