/** * make a get request, with the supplied progress and logging info. * All the other config parameters are set at the task level, * source, dest, ignoreErrors, etc. * @param logLevel level to log at, see {@link Project#log(String, int)} * @param progress progress callback; null for no-callbacks * @return true for a successful download, false otherwise. * The return value is only relevant when {@link #ignoreErrors} is true, as * when false all failures raise BuildExceptions. * @throws IOException for network trouble * @throws BuildException for argument errors, or other trouble when ignoreErrors * is false. * @deprecated only gets the first configured resource */ @Deprecated public boolean doGet(final int logLevel, final DownloadProgress progress) throws IOException { checkAttributes(); return doGet(sources.iterator().next().as(URLProvider.class).getURL(), destination, logLevel, progress); }
doGet(source, dest, logLevel, progress); } catch (final IOException ioe) { log("Error getting " + source + " to " + dest);
private void onlineDownload(URL source, File dest) throws IOException { Get get = (Get) getProject().createTask("get"); DownloadProgress progress = null; if (verbose) { progress = new Get.VerboseProgress(System.out); } get.setUseTimestamp(true); get.setUsername(username); get.setPassword(password); get.setMaxTime(maxDownloadTime); get.doGet(source, dest, Project.MSG_INFO, progress); }