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; }