Package com.jalios.jcms.tools.patch
Class JumboPatchMaker
java.lang.Object
org.apache.commons.io.DirectoryWalker
com.jalios.jcms.tools.patch.JumboPatchMaker
public class JumboPatchMaker
extends org.apache.commons.io.DirectoryWalker
Create a "jumbo" patch suitable for easier migration between maintenance revision of JCMS.
Usage :
JumboPatchMaker jcms-6.0.war|jcms-6.0-directory jcms-6.0-sp2.war|jcms-6.0-sp2-directory patch-jcms-6.0-to-6.0-sp2.zipTechnical note regarding the process :
- Step 1 : war files are unzipped if needed, each webapp content is read to retrieve misc information (check it is a JCMS webapp, retrieve version, etc)
- Step 2 : new or modified files from war 2 are copied in a temporary patch directory. Somes files are ignored (store.xml, webapp.prop, custom.prop, generated files, thumbnail, etc).
- Step 3 : deleted files (between war 1 and war 2) are marked in the patch directory using an empty file.
- Step 4 : reference file from war 2 (store.xml, custom.prop, webapp.prop) are copied in patch directory with suffix ".default"
- Step 5 : zip file is created from temp directory.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.io.DirectoryWalker
org.apache.commons.io.DirectoryWalker.CancelException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intJumboPatchMaker exit code if invalid parameters were specifiedstatic final intJumboPatchMaker exit code in case any error occursstatic final intJumboPatchMaker exit code when everything went fine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreatePatch(File war1File, File war2File, File destPatchFile) Create a patch from difference between war1 and war2 to the specified file.protected booleanhandleDirectory(File directory, int depth, Collection results) protected voidhandleFile(File file, int depth, Collection results) static voidJumboPatchMaker main enty pointMethods inherited from class org.apache.commons.io.DirectoryWalker
checkIfCancelled, filterDirectoryContents, handleCancelled, handleDirectoryEnd, handleDirectoryStart, handleEnd, handleIsCancelled, handleRestricted, handleStart, walk
-
Field Details
-
STATUS_OK
public static final int STATUS_OKJumboPatchMaker exit code when everything went fine- See Also:
-
STATUS_BAD_PARAMETERS
public static final int STATUS_BAD_PARAMETERSJumboPatchMaker exit code if invalid parameters were specified- See Also:
-
STATUS_ERROR
public static final int STATUS_ERRORJumboPatchMaker exit code in case any error occurs- See Also:
-
-
Constructor Details
-
JumboPatchMaker
public JumboPatchMaker()
-
-
Method Details
-
createPatch
Create a patch from difference between war1 and war2 to the specified file.- Parameters:
war1File- a war file or webapp directory (must be a JCMS webapp)war2File- a war file or webapp directory (must be a JCMS webapp with a higher version than war1File)destPatchFile- the zip File in which patch will be created, must NOT exists.- Returns:
- true if the patch was created, false if any error occured.
-
handleDirectory
- Overrides:
handleDirectoryin classorg.apache.commons.io.DirectoryWalker- Throws:
IOException
-
handleFile
- Overrides:
handleFilein classorg.apache.commons.io.DirectoryWalker- Throws:
IOException
-
main
JumboPatchMaker main enty point- Parameters:
args- jumbo patch maker command line parameter
-