/** * Returns the file resolved from URL and directory * @param extension the extension * @param project the project * @return file the file resolved * @throws BuildException if the URL is invalid */ @Override public File resolve(final Extension extension, final Project project) throws BuildException { validate(); final File file = getDest(); final Get get = new Get(); get.setProject(project); get.setDest(file); get.setSrc(url); get.execute(); return file; }
get.setSrc(url); get.setUseTimestamp(true); get.execute();
get.setSrc(url); get.setUseTimestamp(true); get.execute();
get.setSrc(pomLocation); get.setDest(pom); get.execute();
private File get(final URL url, final String expectedChecksum) { final File tempPluginFile = new File(tempDir, "plugin.zip"); final Get get = new Get(); get.setProject(getProject()); get.setTaskName("get"); get.setSrc(url); get.setDest(tempPluginFile); get.setIgnoreErrors(false); get.setVerbose(false); get.execute(); if (expectedChecksum != null) { final String checksum = getFileHash(tempPluginFile); if (!checksum.equalsIgnoreCase(expectedChecksum)) { throw new BuildException(new IllegalArgumentException(String.format("Downloaded plugin file checksum %s does not match expected value %s", checksum, expectedChecksum))); } } return tempPluginFile; }
/** * Extracts jonas-starter from jonas-builder archive. * @param builderJar the jonas-builder location */ public void initStarter(final String builderJar) throws BuilderException { Get get = new Get(); Project project = new Project(); try { get.setSrc(new URL(builderJar)); get.setDest(this.workdirectory); get.setProject(project); get.execute(); setStarterDefaultLocation(new File(this.workdirectory.getAbsolutePath(), this.jonasStarterJarFileTmpName)); } catch (MalformedURLException ex) { Logger.getLogger(Builder.class.getName()).log(Level.SEVERE, null, ex); } Unzip unzip = new Unzip(this.output); unzip.setVerboseMode(this.verboseMode); unzip.setSrc(new File(builderJar)); setStarterDefaultLocation(new File(this.workdirectory.getAbsolutePath(), this.jonasStarterJarFileTmpName)); unzip.setDest(this.workdirectory); try { unzip.execute(); } catch (UnzipException e) { throw new BuilderException("Unable to initialize starter", e); } }
get.setSrc(starterUrl); get.setDest(this.workdirectory); get.setProject(project);
if (Utility.testConnexionURL(new URL(this.applicationLocation[i]))) { try { get.setSrc(new URL(this.applicationLocation[i])); get.setDest(new File(destFolder)); get.setProject(project);
protected void downloadWithAnt(final URL url, final File outputFile) { Project p = new Project(); p.addBuildListener(new AntJettyLoggerBuildListener(LOGGER)); Get g = new Get(); g.setProject(p); g.setSrc(url); g.setDest(outputFile); g.execute(); }
getTask.setSrc(this.remoteLocation); String userInfo = this.remoteLocation.getUserInfo(); if (userInfo != null)
protected void downloadWithAnt(final URL url, final File outputFile) { Project p = new Project(); p.addBuildListener(new AntJettyLoggerBuildListener(LOGGER)); Get g = new Get(); g.setProject(p); g.setSrc(url); g.setDest(outputFile); g.execute(); }
get.setSrc(new URL(this.url)); } catch (MalformedURLException ex) { this.output.write(ex.getMessage());