|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.util.diffmerge.ExternalRunner
public class ExternalRunner
Static methods to handle the creation and completion of external processes launched to compare or merge file content.
Constructor Summary | |
---|---|
ExternalRunner()
|
Method Summary | |
---|---|
static com.microsoft.tfs.util.process.ProcessRunner |
beginMerge(ThreeWayMerge twm,
ExternalTool tool,
com.microsoft.tfs.util.process.ProcessFinishedHandler finishedHandler,
java.io.OutputStream capturedStandardOutput,
java.io.OutputStream capturedStandardError)
Runs an external merge tool to complete the given three way merge. |
static java.lang.String[] |
combineCommandAndArguments(java.lang.String command,
java.lang.String[] arguments)
Combine the given command string and argument strings into one array to pass to something like Runtime.exec(String[]) . |
static boolean |
endMerge(com.microsoft.tfs.util.process.ProcessRunner mergeProcessRunner,
java.lang.String mergedFileName)
Ends an external merge that was run via ProcessRunner . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExternalRunner()
Method Detail |
---|
public static com.microsoft.tfs.util.process.ProcessRunner beginMerge(ThreeWayMerge twm, ExternalTool tool, com.microsoft.tfs.util.process.ProcessFinishedHandler finishedHandler, java.io.OutputStream capturedStandardOutput, java.io.OutputStream capturedStandardError) throws ExternalToolException
You probably don't want to call this method to perform merges. See
ThreeWayMerge.beginExternalMerge(Conflict, ExternalTool, ProcessFinishedHandler, OutputStream, OutputStream)
instead.
twm
- the three way merge to run (must not be null
)tool
- the merge tool to use (must not be null
)finishedHandler
- an event handler whose methods are invoked when the process runner
reaches one of its terminal states. The caller would normally
implement the handler to call
endMerge(ProcessRunner, String)
when the runner reaches
any terminal state. May be null if no state information is
desired.capturedStandardOutput
- a stream to capture the text written by the child process to its
standard output stream. Pass null if you don't want this output.
See the warning in ProcessRunner
's Javadoc about
deadlock.
capturedStandardError
- a stream to capture the text written by the child process to its
standard error stream. Pass null if you don't want this output.
See the warning in ProcessRunner
's Javadoc about
deadlock.
ExternalToolException
- if the configured merge command or arguments string caused a
problem creating the merge tool.public static boolean endMerge(com.microsoft.tfs.util.process.ProcessRunner mergeProcessRunner, java.lang.String mergedFileName)
ProcessRunner
. If the
runner is not already in a terminal state, this method
ProcessRunner.waitForFinish()
and blocks until it enters one.
It is safe to call into this method inside a
ProcessFinishedHandler
method, because the state of the runner is
guaranteed to be a terminal state when these methods are invoked, and
this method can proceed immediately if the runner has reached a terminal
state.
mergeProcessRunner
- the process runner returned by
beginMerge(ThreeWayMerge, ExternalTool, ProcessFinishedHandler, OutputStream, OutputStream)
If null, the merge is a failure and false is returned.mergedFileName
- the file name of the merge result to check for on disk. Caller
does not need to ensure this file exists (this method does that).
Must not be null.
public static java.lang.String[] combineCommandAndArguments(java.lang.String command, java.lang.String[] arguments)
Runtime.exec(String[])
.
command
- the command (must not be null
)arguments
- the arguments (must not be null
)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |