Class PatchUtils

java.lang.Object
org.wso2.carbon.server.util.PatchUtils

public class PatchUtils extends Object
  • 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

      public static void copyLatestServicepack(File source, File target, BufferedWriter bufWriter)
      This will copy jar files on servicepacks to plugins directory
      Parameters:
      source - servicepack directory
      target - 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 directory
      parentPatchDir - 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 location
      plugins - 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()