Class PMControllerHelper


  • public class PMControllerHelper
    extends java.lang.Object
    The PMControllerHelper class implements utility methods that are utilized by the PMController class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static InstallationDescriptor.ActionInfo createEnvAction​(java.lang.String envVarName, java.lang.String envVarValue)
      Creates a 'set_env_variable' action object based on given environment variable name and value.
      private static InstallationDescriptor.ActionInfo createFileAction​(java.lang.String filePath, java.lang.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.
      (package private) static InstallationDescriptor generateMergedInstallationDescriptor​(java.io.File rootDir, java.lang.String aggCompName, java.io.File aggDescFile, InstallationDescriptor[] dlgInstDescs, java.io.File[] dlgRootDirs)
      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.
      (package private) static InstallationDescriptor processDescriptors​(java.io.File rootDir)
      Processes all delegate installation descriptors, component descriptors and configuration files, adjusting 'macros' for a given delegate root directory.
      (package private) static void processFiles​(java.io.File rootDir, java.lang.String targetDirName, InstallationDescriptor insdObject)
      Processes all files in a given target directory, adjusting 'macros' for a given delegate root directory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PMControllerHelper

        public PMControllerHelper()
    • Method Detail

      • createEnvAction

        private static InstallationDescriptor.ActionInfo createEnvAction​(java.lang.String envVarName,
                                                                         java.lang.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​(java.lang.String filePath,
                                                                          java.lang.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​(java.io.File rootDir,
                                                                           java.lang.String aggCompName,
                                                                           java.io.File aggDescFile,
                                                                           InstallationDescriptor[] dlgInstDescs,
                                                                           java.io.File[] dlgRootDirs)
                                                                    throws java.io.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.
        aggDescFile - The given output aggregate component descriptor file.
        aggCompName - The given output aggregate component name (ID).
        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:
        java.io.IOException - If an I/O exception occurred.
      • processDescriptors

        static InstallationDescriptor processDescriptors​(java.io.File rootDir)
                                                  throws java.io.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:
        java.io.IOException - If an I/O exception occurred.
      • processFiles

        static void processFiles​(java.io.File rootDir,
                                 java.lang.String targetDirName,
                                 InstallationDescriptor insdObject)
                          throws java.io.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:
        java.io.IOException - If an I/O exception occurred.