Package org.apache.sshd.git
Class AbstractGitCommand
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.server.command.AbstractCommandSupport
-
- org.apache.sshd.server.command.AbstractFileSystemCommand
-
- org.apache.sshd.git.AbstractGitCommand
-
- All Implemented Interfaces:
java.lang.Runnable,FileSystemAware,SessionContextHolder,SessionHolder<ServerSession>,ExecutorServiceCarrier,GitLocationResolverCarrier,Command,CommandDirectErrorStreamAware,CommandDirectInputStreamAware,CommandDirectOutputStreamAware,CommandDirectStreamsAware,CommandLifecycle,ServerSessionAware,ServerSessionHolder
- Direct Known Subclasses:
GitPackCommand,GitPgmCommand
public abstract class AbstractGitCommand extends AbstractFileSystemCommand implements GitLocationResolverCarrier
Provides basic support for GIT command implementations
-
-
Field Summary
Fields Modifier and Type Field Description static intCHARstatic intDELIMITERstatic intENDQUOTEprotected GitLocationResolverrootDirResolverstatic intSTARTQUOTE-
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 protectedAbstractGitCommand(GitLocationResolver rootDirResolver, java.lang.String command, CloseableExecutorService executorService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GitLocationResolvergetGitLocationResolver()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.voidsetErrorStream(java.io.OutputStream err)Set the error stream that can be used by the shell to write its errors.voidsetOutputStream(java.io.OutputStream out)Set the output stream that can be used by the shell to write its output.java.lang.StringtoString()-
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 org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Field Detail
-
CHAR
public static final int CHAR
- See Also:
- Constant Field Values
-
DELIMITER
public static final int DELIMITER
- See Also:
- Constant Field Values
-
STARTQUOTE
public static final int STARTQUOTE
- See Also:
- Constant Field Values
-
ENDQUOTE
public static final int ENDQUOTE
- See Also:
- Constant Field Values
-
rootDirResolver
protected final GitLocationResolver rootDirResolver
-
-
Constructor Detail
-
AbstractGitCommand
protected AbstractGitCommand(GitLocationResolver rootDirResolver, java.lang.String command, CloseableExecutorService executorService)
-
-
Method Detail
-
getGitLocationResolver
public GitLocationResolver getGitLocationResolver()
- Specified by:
getGitLocationResolverin interfaceGitLocationResolverCarrier
-
setOutputStream
public void setOutputStream(java.io.OutputStream out)
Description copied from interface:CommandDirectOutputStreamAwareSet the output stream that can be used by the shell to write its output.- Specified by:
setOutputStreamin interfaceCommandDirectOutputStreamAware- Overrides:
setOutputStreamin classAbstractCommandSupport- Parameters:
out- TheOutputStreamused by the shell to write its output
-
setErrorStream
public void setErrorStream(java.io.OutputStream err)
Description copied from interface:CommandDirectErrorStreamAwareSet the error stream that can be used by the shell to write its errors.- Specified by:
setErrorStreamin interfaceCommandDirectErrorStreamAware- Overrides:
setErrorStreamin classAbstractCommandSupport- Parameters:
err- TheOutputStreamused by the shell to write its errors
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractCommandSupport
-
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-trueif the strings are trimmed before being added to the list- Returns:
- a list of string or an empty list if there are none.
-
-