Class PMControllerHelper
- java.lang.Object
-
- org.apache.uima.tools.pear.merger.PMControllerHelper
-
public class PMControllerHelper extends java.lang.ObjectThePMControllerHelperclass implements utility methods that are utilized by theclass.PMController
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringMAIN_ROOT(package private) static java.lang.StringMAIN_ROOT_REGEX(package private) static java.lang.StringSTANDARD_PATH_SEPARATOR(package private) static charSTANDARD_PATH_SEPARATOR_CHAR
-
Constructor Summary
Constructors Constructor Description PMControllerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static InstallationDescriptor.ActionInfocreateEnvAction(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.ActionInfocreateFileAction(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 InstallationDescriptorgenerateMergedInstallationDescriptor(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 InstallationDescriptorprocessDescriptors(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 voidprocessFiles(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.
-
-
-
Field Detail
-
MAIN_ROOT
static final java.lang.String MAIN_ROOT
- See Also:
- Constant Field Values
-
MAIN_ROOT_REGEX
static final java.lang.String MAIN_ROOT_REGEX
- See Also:
- Constant Field Values
-
STANDARD_PATH_SEPARATOR
static final java.lang.String STANDARD_PATH_SEPARATOR
- See Also:
- Constant Field Values
-
STANDARD_PATH_SEPARATOR_CHAR
static final char STANDARD_PATH_SEPARATOR_CHAR
- See Also:
- Constant Field Values
-
-
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.ActionInfoobject, 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.ActionInfoobject, 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. ReturnsInstallationDescriptorobject 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
InstallationDescriptorobject 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.IOExceptionProcesses 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.
-
-