Package org.wso2.carbon.server.util
Class PatchUtils
java.lang.Object
org.wso2.carbon.server.util.PatchUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyServicepacksAndPatches(File servicepackDir, File patchesDir, File pluginsDir) Here is the patch applying algorithm.static voidcheckMD5Checksum(Map<String, JarInfo> latestPatchedJar, File plugins, boolean applyPatches) static booleancheckUpdatedJars(Map<String, JarInfo> latestPatchedJar) static voidcopyLatestServicepack(File source, File target, BufferedWriter bufWriter) This will copy jar files on servicepacks to plugins directorystatic FilegetMostLatestJarsInServicepackAndPatches(File servicepackDir, File parentPatchDir) get the list of most latest jars in latest servicepack and patches-xxx directoriesstatic Filestatic FilenameFilterstatic PatchInfoprocessPatches(File patchDirLogFile, File servicepackDir, File patchesDir)
-
Constructor Details
-
PatchUtils
public PatchUtils()
-
-
Method Details
-
applyServicepacksAndPatches
public static void applyServicepacksAndPatches(File servicepackDir, File patchesDir, File pluginsDir) throws IOException Here is the patch applying algorithm. 1) Creates a patch0000 (if it does not exist) inside the patches directory. Backup all the bundles in the plugins directory 2) Before applying patches on components/patches directory apply servicepacks on components/servicepacks directory 3) Then copy remaining patches which not contain on servicepacks patchxxxx to the plugins folder.- Parameters:
servicepackDir- parent servicepack directory "repository/components/servicepacks"patchesDir- parent patch directory "repository/components/patches"pluginsDir- plugin directory "repository/components/plugins"- Throws:
IOException
-
copyLatestServicepack
This will copy jar files on servicepacks to plugins directory- Parameters:
source- servicepack directorytarget- plugin directory- Throws:
IOException
-
processPatches
public static PatchInfo processPatches(File patchDirLogFile, File servicepackDir, File patchesDir) throws IOException - Throws:
IOException
-
getMostLatestJarsInServicepackAndPatches
public static Map<String,JarInfo> getMostLatestJarsInServicepackAndPatches(File servicepackDir, File parentPatchDir) throws Exception get the list of most latest jars in latest servicepack and patches-xxx directories- Parameters:
servicepackDir- servicepack directoryparentPatchDir- folder which contains the patches.- Returns:
- list of most latest jars in latest servicepack and patches directories
- Throws:
Exception
-
checkMD5Checksum
public static void checkMD5Checksum(Map<String, JarInfo> latestPatchedJar, File plugins, boolean applyPatches) throws Exception- Parameters:
latestPatchedJar- map of jar name and jar locationplugins- plugins directory- Throws:
Exception
-
checkUpdatedJars
- Throws:
Exception
-
getPatchesLogsFile
-
getMetaDirectory
-
getPatchFileNameFilter
-