Collection installs = new HashSet(20);
for (int i = 0; i < eclipsePathList.length; i++) {
// For a given Eclipse installation, determine the code to be installed
EclipseInstallation eclipse = new EclipseInstallation(new File(eclipsePathList[i]));
IProductVersion eclipseTarget = adjustEclipseTarget(eclipse.getEclipseVersion());
if (options.isVerbose()) {
System.out.println("eclipse");
System.out.println(" found eclipse version = " + eclipse.getEclipseVersion());
System.out.println(" found product version = " + eclipse.getProductVersion());
System.out.println(" mapped version = " + eclipseTarget.getMajor() + "." + eclipseTarget.getMinor()
+ "." + eclipseTarget.getService());
System.out.println("processing " + eclipsePathList[i]);
System.out.println(" installDir = " + installDir);
System.out.println(" eclipse found version = ");
System.out.println(" targetDir = E-" + (eclipseTarget.getMajor() + "." + eclipseTarget.getMinor()));
System.out.println(" selfpath = " + selfPath);
System.out.println(" image = " + image);
}
for (int j = 0; j < subProducts.length; j++) {
SubProduct each = subProducts[j];
if (options.isVerbose()) {
System.out.println("processing " + each);
System.out.println(" each.instdir = " + each.getInstallDirName());
}
// Check to see if subproduct can be linked to this eclipse installation
// Allow each subproduct to determine whether they can link
// to this eclipse installation and what version should be linked
IProductVersion eachEclipseTarget = each.adjustEclipseTarget(image, eclipse, eclipseTarget, options);
if (eachEclipseTarget == null) {
if (options.isVerbose())
System.out.println(" cannot link " + each + " to " + eclipsePathList[i]);
continue;
}
if (options.isVerbose()) {
System.out.println("can link to " + eclipse.getProductDir().getAbsolutePath());
}
String eachEclipseTargetString = eachEclipseTarget.getMajor() + "." + eachEclipseTarget.getMinor();
String relInstallPath = each.getInstallDirName() + File.separator + "E-" + eachEclipseTargetString;
File installSubDir = new File(installDir, relInstallPath);
// Install the sub product if not already installed
if (!installs.contains(relInstallPath)) {
installs.add(relInstallPath);
if (options.isVerbose()) {
System.out.println("searching for " + BaseProductInstaller.INSTALL_IMAGE + "/" + each.getName()
+ "/E-" + eachEclipseTargetString);
System.out.println(BaseProductInstaller.INSTALL_IMAGE + "/" + each.getName() + "/E-common");
}
ZipEntry[] entries = each.getEntries(image, eachEclipseTarget);
if (entries == null) {
throw new FileNotFoundException("Nothing found searching for " +
BaseProductInstaller.INSTALL_IMAGE + "/" +
each.getName()+
"/E-" + eachEclipseTargetString + " and " +
BaseProductInstaller.INSTALL_IMAGE + "/" +
each.getName() + "/E-common");
}
if (options.isVerbose()) {
if (entries == null) {
System.out.println("ZipEntries is null");
}
else {
System.out.println("ZipEntries size " + entries.length);
}
}
for (int k = 0; k < entries.length; k++) {
if (options.isVerbose()) {
if (entries[k] == null) {
System.out.println("processing ZipEntry[ " + k + "] is null");
}
else {
System.out.println("ZipEntry [" + k + "] = " + entries[k].getName());
}
}
if (entries[k] == null) {
throw new FileNotFoundException("one of the following is not found " +
BaseProductInstaller.INSTALL_IMAGE + "/" +
each.getName()+
"/E-" + eachEclipseTargetString + " or " +
BaseProductInstaller.INSTALL_IMAGE + "/" +
each.getName() + "/E-common");
}
step.add(new ExtractDirectoryOperation(image, entries[k], installSubDir));
}
}
// Link the eclipse installation to the installed code
step.add(new LinkProductOperation(options, new String[]{
eclipse.getProductDir().getAbsolutePath()
}, each.getLinkId(), installSubDir));
// If CLeanup CruiseControl Style link files
if (each.getName().equalsIgnoreCase("CodeProCore")) {
if (options.isVerbose()) {