com.starteam.viewcomparemerge
Class WorkstationDefaultMergeAdapter

java.lang.Object
  extended by com.starteam.viewcomparemerge.FileMergeAdapter
      extended by com.starteam.viewcomparemerge.WorkstationDefaultMergeAdapter

public class WorkstationDefaultMergeAdapter
extends FileMergeAdapter

Uses the workstation default merge tool to resolve a file merge condition. For example:

 FileMergeAdapter tool = new WorkstationDefaultMergeAdapter(diff);
 int exitCode = tool.merge();
 if (exitCode == 0) {
        System.out.println("The merge was successful!");
 } else {
        System.out.println("The merge failed with exit code: " + exitCode);
 }
 
Note that if no file merge tool is registered in starteam-client-options.xml, then StarTeam File Compare / Merge (also known as "Delta II") is used by default.

See Also:
StarTeamFileMergeAdapter, VisMergeAdapter, CustomThreeWayMergeAdapter, FileMergeAdapter

Field Summary
 
Fields inherited from class com.starteam.viewcomparemerge.FileMergeAdapter
PARAM_COMMON_ANCESTOR, PARAM_OUTPUT_FILE, PARAM_SOURCE_ANCESTOR, PARAM_SOURCE_FILE, PARAM_TARGET_ANCESTOR, PARAM_TARGET_FILE
 
Constructor Summary
WorkstationDefaultMergeAdapter(ItemDifference diff)
          Constructs an adapter for resolving a given file merge condition.
 
Method Summary
 int merge()
          Runs the external merge tool with parameters that are appropriate for resolving the merge condition of this adapter's ItemDifference.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkstationDefaultMergeAdapter

public WorkstationDefaultMergeAdapter(ItemDifference diff)
Constructs an adapter for resolving a given file merge condition.

Parameters:
diff - The ItemDifference whose file merge condition is to be resolved.
Method Detail

merge

public int merge()
          throws java.io.IOException
Runs the external merge tool with parameters that are appropriate for resolving the merge condition of this adapter's ItemDifference.

If the merge is successful, then the adapter applies the output merged file content to the ItemDifference, and marks the merge condition as resolved.

Any temporary files created during the process are automatically removed.

Overrides:
merge in class FileMergeAdapter
Returns:
The tool's exit code. Zero on success.
Throws:
java.io.IOException - If an error occurs during the invocation of the tool.


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.