Package org.wso2.carbon.server.util
Class PatchUtils
- java.lang.Object
-
- org.wso2.carbon.server.util.PatchUtils
-
public class PatchUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description PatchUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 FilegetMetaDirectory()static Map<String,JarInfo>getMostLatestJarsInServicepackAndPatches(File servicepackDir, File parentPatchDir)get the list of most latest jars in latest servicepack and patches-xxx directoriesstatic FilegetPatchesLogsFile()static FilenameFiltergetPatchFileNameFilter()static PatchInfoprocessPatches(File patchDirLogFile, File servicepackDir, File patchesDir)
-
-
-
Method Detail
-
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
public static void copyLatestServicepack(File source, File target, BufferedWriter bufWriter)
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
public static boolean checkUpdatedJars(Map<String,JarInfo> latestPatchedJar) throws Exception
- Throws:
Exception
-
getPatchesLogsFile
public static File getPatchesLogsFile()
-
getMetaDirectory
public static File getMetaDirectory()
-
getPatchFileNameFilter
public static FilenameFilter getPatchFileNameFilter()
-
-