if(!carFile.exists() || !carFile.canRead()) {
throw new DeploymentException("CAR file cannot be read: "+carFile.getAbsolutePath());
}
Object key = mgr.startInstall(carFile, null, null);
long start = System.currentTimeMillis();
DownloadResults results = showProgress(mgr, key);
int time = (int)(System.currentTimeMillis() - start) / 1000;
System.out.println();
if(!results.isFailed()) {
System.out.print(DeployUtils.reformat("**** Installation Complete!", 4, 72));
for (int i = 0; i < results.getDependenciesPresent().length; i++) {
Artifact uri = results.getDependenciesPresent()[i];
System.out.print(DeployUtils.reformat("Used existing: "+uri, 4, 72));
}
for (int i = 0; i < results.getDependenciesInstalled().length; i++) {
Artifact uri = results.getDependenciesInstalled()[i];
System.out.print(DeployUtils.reformat("Installed new: "+uri, 4, 72));
}
if(results.getTotalDownloadBytes() > 0 && time > 0) {
System.out.println();
System.out.print(DeployUtils.reformat("Downloaded "+(results.getTotalDownloadBytes()/1024)+" kB in "+time+"s ("+results.getTotalDownloadBytes()/(1024*time)+" kB/s)", 4, 72));
}
}
if(results.isFinished() && !results.isFailed() && results.getInstalledConfigIDs().length == 1) {
Artifact target = results.getInstalledConfigIDs()[0];
System.out.print(DeployUtils.reformat("Now starting "+target+"...", 4, 72));
System.out.flush();
new CommandStart().execute(out, connection, new BaseCommandArgs(new String[]{target.toString()}));
}
} else {