Class PMControllerHelper
java.lang.Object
org.apache.uima.tools.pear.merger.PMControllerHelper
The
PMControllerHelper
class implements utility methods that are utilized by the
PMController
class.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static InstallationDescriptor.ActionInfo
createEnvAction
(String envVarName, String envVarValue) Creates a 'set_env_variable' action object based on given environment variable name and value.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.(package private) static InstallationDescriptor
generateMergedInstallationDescriptor
(File rootDir, String aggCompName, File aggDescFile, InstallationDescriptor[] dlgInstDescs, 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
(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
(File rootDir, String targetDirName, InstallationDescriptor insdObject) Processes all files in a given target directory, adjusting 'macros' for a given delegate root directory.
-
Field Details
-
MAIN_ROOT
- See Also:
-
MAIN_ROOT_REGEX
- See Also:
-
STANDARD_PATH_SEPARATOR
- See Also:
-
STANDARD_PATH_SEPARATOR_CHAR
static final char STANDARD_PATH_SEPARATOR_CHAR- See Also:
-
-
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. ReturnsInstallationDescriptor
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:
IOException
- If an I/O exception occurred.
-
processDescriptors
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.
-