private File _download(String url, File destinationFile) throws IOException { String protocol = url.substring(0, url.indexOf(':')); String proxyPassword = System.getProperty(protocol + ".proxyPassword"); String proxyUser = System.getProperty(protocol + ".proxyUser"); if (Validator.isNotNull(proxyPassword) && Validator.isNotNull(proxyUser)) { Project project = getProject(); String nonProxyHosts = System.getProperty( protocol + ".nonProxyHosts"); String proxyHost = System.getProperty(protocol + ".proxyHost"); String proxyPort = System.getProperty(protocol + ".proxyPort"); AntBuilder antBuilder = project.getAnt(); Map<String, String> args = new HashMap<>(); args.put("nonproxyhosts", nonProxyHosts); args.put("proxyhost", proxyHost); args.put("proxypassword", proxyPassword); args.put("proxyport", proxyPort); args.put("proxyuser", proxyUser); antBuilder.invokeMethod("setproxy", args); } return FileUtil.get(getProject(), url, destinationFile); }
private File _download(String url, File destinationFile) throws IOException { String protocol = url.substring(0, url.indexOf(':')); String proxyPassword = System.getProperty(protocol + ".proxyPassword"); String proxyUser = System.getProperty(protocol + ".proxyUser"); if (Validator.isNotNull(proxyPassword) && Validator.isNotNull(proxyUser)) { Project project = getProject(); String nonProxyHosts = System.getProperty( protocol + ".nonProxyHosts"); String proxyHost = System.getProperty(protocol + ".proxyHost"); String proxyPort = System.getProperty(protocol + ".proxyPort"); AntBuilder antBuilder = project.getAnt(); Map<String, String> args = new HashMap<>(); args.put("nonproxyhosts", nonProxyHosts); args.put("proxyhost", proxyHost); args.put("proxypassword", proxyPassword); args.put("proxyport", proxyPort); args.put("proxyuser", proxyUser); antBuilder.invokeMethod("setproxy", args); } return FileUtil.get(getProject(), url, destinationFile); }
public DownloadNodeTask() { _nodeExecutor = new NodeExecutor(getProject()); onlyIf( new Spec<Task>() { @Override public boolean isSatisfiedBy(Task task) { File nodeDir = getNodeDir(); if ((nodeDir != null) && nodeDir.exists()) { return false; } return true; } }); }
public DownloadNodeTask() { _nodeExecutor = new NodeExecutor(getProject()); onlyIf( new Spec<Task>() { @Override public boolean isSatisfiedBy(Task task) { File nodeDir = getNodeDir(); if ((nodeDir != null) && nodeDir.exists()) { return false; } return true; } }); }
private void _configureTaskDownloadNodeGlobal( DownloadNodeTask downloadNodeTask, NodeExtension nodeExtension) { Project project = downloadNodeTask.getProject();
private void _configureTaskDownloadNodeGlobal( DownloadNodeTask downloadNodeTask, NodeExtension nodeExtension) { Project project = downloadNodeTask.getProject();
@TaskAction public void downloadNode() throws IOException { final File nodeDir = getNodeDir(); final Project project = getProject();
@TaskAction public void downloadNode() throws IOException { final File nodeDir = getNodeDir(); final Project project = getProject();