Java API Sample
This sample is a basic demonstration of how to use Merge's Java API to run some simple Merge operations with
hard-coded file paths.
The sample is implemented in the
main method of a single Java class,
SimpleRunner.java, and the approach taken is as follows:
- Create File
objects for sample inputs.
- Instantiate the merge object using either ConcurrentMerge or SequentialMerge;
- Set the ancestor file (Only for ConcurrentMerge) with:
- Add the demo input versions by using one of the following:
- Call one of the following methods to produce a DeltaV2 representation of the merge.
ThreeWayMerge class can be used with one of its
merge methods to allow merge operations to be
performed with a single method call. This class also allows the approach shown above but we only demonstrate
the simpler method calls in the sample code.
To run this sample, you will require Apache Ant and a
JDK. From a command prompt in the sample directory, you can invoke the sample
The following targets are supplied in:
|Default. This depends on the |
compile target, and runs the main method
SimpleRunner.java into a Java
.class file in the
class directory, which can be invoked either through the java command
or from the ant
run target above.
|This deletes everything in the |