Class AbstractGitCommand

  • All Implemented Interfaces:
    java.lang.Runnable, org.apache.sshd.common.file.FileSystemAware, org.apache.sshd.common.session.SessionContextHolder, org.apache.sshd.common.session.SessionHolder<org.apache.sshd.server.session.ServerSession>, org.apache.sshd.common.util.threads.ExecutorServiceCarrier, GitLocationResolverCarrier, org.apache.sshd.server.command.Command, org.apache.sshd.server.command.CommandDirectErrorStreamAware, org.apache.sshd.server.command.CommandDirectInputStreamAware, org.apache.sshd.server.command.CommandDirectOutputStreamAware, org.apache.sshd.server.command.CommandDirectStreamsAware, org.apache.sshd.server.command.CommandLifecycle, org.apache.sshd.server.session.ServerSessionAware, org.apache.sshd.server.session.ServerSessionHolder
    Direct Known Subclasses:
    GitPackCommand, GitPgmCommand

    public abstract class AbstractGitCommand
    extends org.apache.sshd.server.command.AbstractFileSystemCommand
    implements GitLocationResolverCarrier
    Provides basic support for GIT command implementations
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CHAR  
      static int DELIMITER  
      static int ENDQUOTE  
      protected GitLocationResolver rootDirResolver  
      static int STARTQUOTE  
      • Fields inherited from class org.apache.sshd.server.command.AbstractFileSystemCommand

        fileSystem
      • Fields inherited from class org.apache.sshd.server.command.AbstractCommandSupport

        cbCalled, cmdRunner, executorService
      • Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

        log
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractGitCommand​(GitLocationResolver rootDirResolver, java.lang.String command, org.apache.sshd.common.util.threads.CloseableExecutorService executorService)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      GitLocationResolver getGitLocationResolver()  
      static java.util.List<java.lang.String> parseDelimitedString​(java.lang.String value, java.lang.String delim, boolean trim)
      Parses delimited string and returns an array containing the tokens.
      void setErrorStream​(java.io.OutputStream err)  
      void setOutputStream​(java.io.OutputStream out)  
      java.lang.String toString()  
      • Methods inherited from class org.apache.sshd.server.command.AbstractFileSystemCommand

        destroy, getFileSystem, setFileSystem
      • Methods inherited from class org.apache.sshd.server.command.AbstractCommandSupport

        getCommand, getEnvironment, getErrorStream, getExecutorService, getExitCallback, getInputStream, getOutputStream, getServerSession, getSession, getStartedCommandFuture, onExit, onExit, setExitCallback, setInputStream, setSession, start
      • Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

        debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.apache.sshd.common.file.FileSystemAware

        setFileSystemFactory
      • Methods inherited from interface java.lang.Runnable

        run
      • Methods inherited from interface org.apache.sshd.common.session.SessionHolder

        getSessionContext
    • Constructor Detail

      • AbstractGitCommand

        protected AbstractGitCommand​(GitLocationResolver rootDirResolver,
                                     java.lang.String command,
                                     org.apache.sshd.common.util.threads.CloseableExecutorService executorService)
    • Method Detail

      • setOutputStream

        public void setOutputStream​(java.io.OutputStream out)
        Specified by:
        setOutputStream in interface org.apache.sshd.server.command.CommandDirectOutputStreamAware
        Overrides:
        setOutputStream in class org.apache.sshd.server.command.AbstractCommandSupport
      • setErrorStream

        public void setErrorStream​(java.io.OutputStream err)
        Specified by:
        setErrorStream in interface org.apache.sshd.server.command.CommandDirectErrorStreamAware
        Overrides:
        setErrorStream in class org.apache.sshd.server.command.AbstractCommandSupport
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.apache.sshd.server.command.AbstractCommandSupport
      • parseDelimitedString

        public static java.util.List<java.lang.String> parseDelimitedString​(java.lang.String value,
                                                                            java.lang.String delim,
                                                                            boolean trim)
        Parses delimited string and returns an array containing the tokens. This parser obeys quotes, so the delimiter character will be ignored if it is inside of a quote. This method assumes that the quote character is not included in the set of delimiter characters.
        Parameters:
        value - the delimited string to parse.
        delim - the characters delimiting the tokens.
        trim - true if the strings are trimmed before being added to the list
        Returns:
        a list of string or an empty list if there are none.