org.codehaus.cargo.module.webapp.merge
Class WarArchiveMerger

java.lang.Object
  extended by org.codehaus.cargo.module.webapp.merge.WarArchiveMerger
All Implemented Interfaces:
MergeProcessor

public class WarArchiveMerger
extends java.lang.Object
implements MergeProcessor

Class for merging two War Archives into each other.

Version:
$Id: WarArchiveMerger.java 1705 2008-09-02 13:14:55Z adriana $

Constructor Summary
WarArchiveMerger()
          Constructor Class for merging War archives together.
 
Method Summary
 void addMergeItem(java.lang.Object mergeItem)
          Add an item to be merged.
 void addMergeProcessor(java.lang.String path, MergeProcessor merger)
          Add a merging processor that merges specified items witin the war files.
 WebXmlMerger getWebXmlMerger()
          Get the class used for web xml merging.
 java.lang.Object performMerge()
          Perform the merge.
 void performMerge(java.io.File targetFile)
          Perform the archive merge, using the specified file as the output destination.
 void setMergeJarFiles(boolean doMergeJarFiles)
          Control whether the merge should include JAR files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WarArchiveMerger

public WarArchiveMerger()
Constructor Class for merging War archives together.

Method Detail

addMergeProcessor

public void addMergeProcessor(java.lang.String path,
                              MergeProcessor merger)
Add a merging processor that merges specified items witin the war files.

Parameters:
path - in the path to merge to
merger - in the merger

addMergeItem

public void addMergeItem(java.lang.Object mergeItem)
                  throws MergeException
Add an item to be merged.

Specified by:
addMergeItem in interface MergeProcessor
Parameters:
mergeItem - in the item to merge.
Throws:
MergeException - on exceptions
See Also:
MergeProcessor.addMergeItem(java.lang.Object)

performMerge

public java.lang.Object performMerge()
Perform the merge.

Specified by:
performMerge in interface MergeProcessor
Returns:
the merged artifact
See Also:
MergeProcessor.performMerge()

performMerge

public void performMerge(java.io.File targetFile)
                  throws java.io.IOException,
                         org.jdom.JDOMException
Perform the archive merge, using the specified file as the output destination.

Parameters:
targetFile - The target file to output to.
Throws:
org.jdom.JDOMException - If a JDOM exception occurs
java.io.IOException - If an IO exception occurs

setMergeJarFiles

public void setMergeJarFiles(boolean doMergeJarFiles)
Control whether the merge should include JAR files.

Parameters:
doMergeJarFiles - true if we do (default)

getWebXmlMerger

public WebXmlMerger getWebXmlMerger()
Get the class used for web xml merging.

Returns:
the Web XML Merger


Copyright © 2004-2011 Codehaus. All Rights Reserved.