* The given installation directory.
*/
private static void installPear(File localPearFile, File installationDir) {
//System.out.println("installPear(\"" + localPearFile + "\", \"" + installationDir + "\")");
InstallationController.setLocalMode(true);
InstallationDescriptorHandler installationDescriptorHandler = new InstallationDescriptorHandler();
printInConsole(false, "");
// check input parameters
if (localPearFile != null && !localPearFile.exists()) {
errorFlag = true;
message = localPearFile.getAbsolutePath() + "file not found \n";
printInConsole(errorFlag, message);
} else {
if(localPearFile != null) {
printInConsole(false, "PEAR file to install is => " + localPearFile.getAbsolutePath() + "\n");
}
}
/* setting current working directory by default */
if (installationDir == null) {
installationDir = new File("./");
}
printInConsole(false,"Installation directory is => " + installationDir.getAbsolutePath() + "\n");
try {
JarFile jarFile = new JarFile(localPearFile);
installationDescriptorHandler.parseInstallationDescriptor(jarFile);
insdObject = installationDescriptorHandler.getInstallationDescriptor();
if (insdObject != null)
mainComponentId = insdObject.getMainComponentId();
else {