private void installNodeForWindows() throws InstallationException {
final String downloadUrl = this.nodeDownloadRoot
+ this.config.getPlatform().getNodeDownloadFilename(this.nodeVersion, false);
try {
File destinationDirectory = getInstallDirectory();
File destination = new File(destinationDirectory, "node.exe");
String classifier = this.config.getPlatform().getNodeClassifier();
CacheDescriptor cacheDescriptor =
new CacheDescriptor("node", this.nodeVersion, classifier, "exe");
File binary = this.config.getCacheResolver().resolve(cacheDescriptor);
downloadFileIfMissing(downloadUrl, binary, this.userName, this.password);
this.logger.info("Copying node binary from {} to {}", binary, destination);
FileUtils.copyFile(binary, destination);
this.logger.info("Installed node locally.");
} catch (DownloadException e) {
throw new InstallationException("Could not download Node.js from: " + downloadUrl, e);
} catch (IOException e) {
throw new InstallationException("Could not install Node.js", e);
}
}