Class PMControllerHelper

java.lang.Object
org.apache.uima.tools.pear.merger.PMControllerHelper

public class PMControllerHelper extends Object
The PMControllerHelper class implements utility methods that are utilized by the PMController class.
  • Field Details

  • Constructor Details

    • PMControllerHelper

      public PMControllerHelper()
  • Method Details

    • createEnvAction

      private static InstallationDescriptor.ActionInfo createEnvAction(String envVarName, String envVarValue)
      Creates a 'set_env_variable' action object based on given environment variable name and value.
      Parameters:
      envVarName - The given environment variable name.
      envVarValue - The given environment variable value.
      Returns:
      The InstallationDescriptor.ActionInfo object, containing the 'set_env_variable' action.
    • createFileAction

      private static InstallationDescriptor.ActionInfo createFileAction(String filePath, String macroPath)
      Creates a 'find_and_replace_path' action object based on given file path and 'macro' path, which is used as both the search string and the replacement string.
      Parameters:
      filePath - The given file path, that specifies the target file for this action.
      macroPath - The given 'macro' path that is used as both the search string and the replacement string (e.g. $main_root).
      Returns:
      The InstallationDescriptor.ActionInfo object, containing the 'find_and_replace_path' action.
    • generateMergedInstallationDescriptor

      static InstallationDescriptor generateMergedInstallationDescriptor(File rootDir, String aggCompName, File aggDescFile, InstallationDescriptor[] dlgInstDescs, File[] dlgRootDirs) throws IOException
      Creates and saves installation descriptor for the merged PEAR, based on given output root directory, output aggregate component descriptor file, output aggregate component name (ID), array of delegate (input) installation descriptors and array of output delegate root directories. Returns InstallationDescriptor object for the merged PEAR.
      Parameters:
      rootDir - The given output root directory.
      aggCompName - The given output aggregate component name (ID).
      aggDescFile - The given output aggregate component descriptor file.
      dlgInstDescs - The given array of delegate (input) installation descriptors.
      dlgRootDirs - The given array of output delegate root directories.
      Returns:
      The InstallationDescriptor object for the merged PEAR.
      Throws:
      IOException - If an I/O exception occurred.
    • processDescriptors

      static InstallationDescriptor processDescriptors(File rootDir) throws IOException
      Processes all delegate installation descriptors, component descriptors and configuration files, adjusting 'macros' for a given delegate root directory. Returns the delegate installation descriptor with adjusted 'macros'.
      Parameters:
      rootDir - The given delegate root directory.
      Returns:
      The elegate installation descriptor with adjusted 'macros'.
      Throws:
      IOException - If an I/O exception occurred.
    • processFiles

      static void processFiles(File rootDir, String targetDirName, InstallationDescriptor insdObject) throws IOException
      Processes all files in a given target directory, adjusting 'macros' for a given delegate root directory. Adds appropriate 'find_and_replace_path' actions to a specified delegate installation descriptor.
      Parameters:
      rootDir - The given delegate root directory.
      targetDirName - The name of the given target directory in the delegate root directory.
      insdObject - The given delegate installation descriptor.
      Throws:
      IOException - If an I/O exception occurred.