Package org.tmatesoft.svn.cli
Class AbstractSVNCommandEnvironment
- java.lang.Object
-
- org.tmatesoft.svn.cli.AbstractSVNCommandEnvironment
-
- All Implemented Interfaces:
ISVNCanceller
- Direct Known Subclasses:
SVNAdminCommandEnvironment
,SVNCommandEnvironment
,SVNDumpFilterCommandEnvironment
,SVNLookCommandEnvironment
,SVNSyncCommandEnvironment
,SVNVersionCommandEnvironment
public abstract class AbstractSVNCommandEnvironment extends java.lang.Object implements ISVNCanceller
- Version:
- 1.3
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List
myArguments
private SVNClientManager
myClientManager
private AbstractSVNCommand
myCommand
private java.lang.String
myCommandName
private java.io.PrintStream
myErr
private java.io.InputStream
myIn
private DefaultSVNOptions
myOptions
private java.io.PrintStream
myOut
private java.lang.String
myProgramName
private boolean
ourIsCancelled
-
Fields inherited from interface org.tmatesoft.svn.core.ISVNCanceller
NULL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSVNCommandEnvironment(java.lang.String programName, java.io.PrintStream out, java.io.PrintStream err, java.io.InputStream in)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
checkCancelled()
Checks if the current operation is cancelled (somehow interrupted) and should throw an SVNCancelException or notify the handler if exists.private SVNURL
checkRootURLOfTarget(SVNURL rootURL, java.lang.String target)
java.util.List<java.lang.String>
combineTargets(java.util.Collection targets, boolean warnReserved)
protected abstract ISVNAuthenticationManager
createClientAuthenticationManager()
SVNClientManager
createClientManager()
protected abstract DefaultSVNOptions
createClientOptions()
void
dispose()
private static boolean
equals(java.lang.String p1, java.lang.String p2)
java.util.List
getArguments()
SVNClientManager
getClientManager()
AbstractSVNCommand
getCommand()
protected abstract java.lang.String
getCommandLineClientName()
java.lang.String
getCommandName()
protected java.lang.String
getCommandName(SVNCommandLine commandLine)
private static java.lang.String
getCommonAncestor(java.lang.String p1, java.lang.String p2)
java.io.PrintStream
getErr()
java.io.InputStream
getIn()
DefaultSVNOptions
getOptions()
java.io.PrintStream
getOut()
java.lang.String
getProgramName()
java.lang.String
getRelativePath(java.io.File file)
SVNURL
getURLFromTarget(java.lang.String target)
void
handleError(SVNErrorMessage err)
boolean
handleWarning(SVNErrorMessage err, SVNErrorCode[] warningCodes, boolean quiet)
void
init(SVNCommandLine commandLine)
void
initClientManager()
protected void
initCommand(SVNCommandLine commandLine)
protected abstract void
initOption(SVNOptionValue optionValue)
protected void
initOptions(SVNCommandLine commandLine)
private static boolean
isReposRelative(java.lang.String path)
boolean
isVersioned(java.lang.String target)
SVNRevision[]
parseRevision(java.lang.String revStr)
java.lang.String
popArgument()
void
printCommitInfo(SVNCommitInfo info)
byte[]
readFromFile(java.io.File file)
protected abstract java.lang.String
refineCommandName(java.lang.String commandName, SVNCommandLine commandLine)
private SVNURL
resolveRepositoryRelativeURL(SVNURL rootURL, java.lang.String relativeURL)
boolean
run()
protected void
setArguments(java.util.List newArguments)
void
setCancelled()
private static boolean
startsWith(java.lang.String p1, java.lang.String p2)
protected void
validateOptions(SVNCommandLine commandLine)
-
-
-
Field Detail
-
ourIsCancelled
private boolean ourIsCancelled
-
myIn
private java.io.InputStream myIn
-
myErr
private java.io.PrintStream myErr
-
myOut
private java.io.PrintStream myOut
-
myClientManager
private SVNClientManager myClientManager
-
myOptions
private DefaultSVNOptions myOptions
-
myArguments
private java.util.List myArguments
-
myProgramName
private java.lang.String myProgramName
-
myCommand
private AbstractSVNCommand myCommand
-
myCommandName
private java.lang.String myCommandName
-
-
Method Detail
-
getProgramName
public java.lang.String getProgramName()
-
getOut
public java.io.PrintStream getOut()
-
getErr
public java.io.PrintStream getErr()
-
getIn
public java.io.InputStream getIn()
-
getClientManager
public SVNClientManager getClientManager()
-
getOptions
public DefaultSVNOptions getOptions()
-
getArguments
public java.util.List getArguments()
-
getCommand
public AbstractSVNCommand getCommand()
-
getCommandName
public java.lang.String getCommandName()
-
popArgument
public java.lang.String popArgument()
-
setArguments
protected void setArguments(java.util.List newArguments)
-
init
public void init(SVNCommandLine commandLine) throws SVNException
- Throws:
SVNException
-
run
public boolean run()
-
initOptions
protected void initOptions(SVNCommandLine commandLine) throws SVNException
- Throws:
SVNException
-
initOption
protected abstract void initOption(SVNOptionValue optionValue) throws SVNException
- Throws:
SVNException
-
validateOptions
protected void validateOptions(SVNCommandLine commandLine) throws SVNException
- Throws:
SVNException
-
initCommand
protected void initCommand(SVNCommandLine commandLine) throws SVNException
- Throws:
SVNException
-
getCommandName
protected java.lang.String getCommandName(SVNCommandLine commandLine) throws SVNException
- Throws:
SVNException
-
refineCommandName
protected abstract java.lang.String refineCommandName(java.lang.String commandName, SVNCommandLine commandLine) throws SVNException
- Throws:
SVNException
-
createClientOptions
protected abstract DefaultSVNOptions createClientOptions() throws SVNException
- Throws:
SVNException
-
createClientAuthenticationManager
protected abstract ISVNAuthenticationManager createClientAuthenticationManager()
-
getCommandLineClientName
protected abstract java.lang.String getCommandLineClientName()
-
initClientManager
public void initClientManager() throws SVNException
- Throws:
SVNException
-
dispose
public void dispose()
-
combineTargets
public java.util.List<java.lang.String> combineTargets(java.util.Collection targets, boolean warnReserved) throws SVNException
- Throws:
SVNException
-
parseRevision
public SVNRevision[] parseRevision(java.lang.String revStr)
-
readFromFile
public byte[] readFromFile(java.io.File file) throws SVNException
- Throws:
SVNException
-
handleError
public void handleError(SVNErrorMessage err)
-
handleWarning
public boolean handleWarning(SVNErrorMessage err, SVNErrorCode[] warningCodes, boolean quiet) throws SVNException
- Throws:
SVNException
-
getRelativePath
public java.lang.String getRelativePath(java.io.File file)
-
getURLFromTarget
public SVNURL getURLFromTarget(java.lang.String target) throws SVNException
- Throws:
SVNException
-
isVersioned
public boolean isVersioned(java.lang.String target) throws SVNException
- Throws:
SVNException
-
printCommitInfo
public void printCommitInfo(SVNCommitInfo info)
-
resolveRepositoryRelativeURL
private SVNURL resolveRepositoryRelativeURL(SVNURL rootURL, java.lang.String relativeURL) throws SVNException
- Throws:
SVNException
-
checkRootURLOfTarget
private SVNURL checkRootURLOfTarget(SVNURL rootURL, java.lang.String target) throws SVNException
- Throws:
SVNException
-
isReposRelative
private static boolean isReposRelative(java.lang.String path)
-
startsWith
private static boolean startsWith(java.lang.String p1, java.lang.String p2)
-
equals
private static boolean equals(java.lang.String p1, java.lang.String p2)
-
getCommonAncestor
private static java.lang.String getCommonAncestor(java.lang.String p1, java.lang.String p2)
-
checkCancelled
public void checkCancelled() throws SVNCancelException
Description copied from interface:ISVNCanceller
Checks if the current operation is cancelled (somehow interrupted) and should throw an SVNCancelException or notify the handler if exists. This method is often called during iterations when processing trees of versioned items. This way the entire operation may be interrupted without waiting till the iteration run out.- Specified by:
checkCancelled
in interfaceISVNCanceller
- Throws:
SVNCancelException
-
setCancelled
public void setCancelled()
-
createClientManager
public SVNClientManager createClientManager()
-
-