public File call() throws Exception { if (download(url, artifactPath)) { verify(url, artifactPath); } return artifactFile; }
@Override public File call() throws Exception { if (download(url, artifactPath)) { verify(url, artifactPath); } return artifactFile; }
public File call() throws Exception { if (download(url, artifactPath)) { verify(url, artifactPath); } return artifactFile; }
public File call() throws Exception { if (download(url, artifactPath)) { verify(url, artifactPath); } return artifactFile; }
@Override public File call() throws Exception { if (download(url, artifactPath)) { verify(url, artifactPath); } return artifactFile; }
/** * Verify the path against its digest for the given algorithm. * * @param repo * @param path * @param algorithm * @throws Exception */ private boolean verify(URI repo, String path, String algorithm) throws Exception { String digestPath = path + "." + algorithm; File actualFile = new File(root, path); if (download(repo, digestPath)) { File digestFile = new File(root, digestPath); final MessageDigest md = MessageDigest.getInstance(algorithm); IO.copy(actualFile, md); byte[] digest = md.digest(); String source = IO.collect(digestFile) .toUpperCase(); String hex = Hex.toHexString(digest) .toUpperCase(); if (source.startsWith(hex)) { System.err.println("Verified ok " + actualFile + " digest " + algorithm); return true; } } System.err.println("Failed to verify " + actualFile + " for digest " + algorithm); return false; }
/** * Verify the path against its digest for the given algorithm. * * @param repo * @param path * @param algorithm * @throws Exception */ private boolean verify(URI repo, String path, String algorithm) throws Exception { String digestPath = path + "." + algorithm; File actualFile = new File(root, path); if (download(repo, digestPath)) { File digestFile = new File(root, digestPath); final MessageDigest md = MessageDigest.getInstance(algorithm); IO.copy(actualFile, md); byte[] digest = md.digest(); String source = IO.collect(digestFile) .toUpperCase(); String hex = Hex.toHexString(digest) .toUpperCase(); if (source.startsWith(hex)) { System.err.println("Verified ok " + actualFile + " digest " + algorithm); return true; } } System.err.println("Failed to verify " + actualFile + " for digest " + algorithm); return false; }
File actualFile = new File(root, path); if (download(repo, digestPath)) { File digestFile = new File(root, digestPath); final MessageDigest md = MessageDigest.getInstance(algorithm);
File actualFile = new File(root, path); if (download(repo, digestPath)) { File digestFile = new File(root, digestPath); final MessageDigest md = MessageDigest.getInstance(algorithm);
File actualFile = new File(root, path); if (download(repo, digestPath)) { File digestFile = new File(root, digestPath); final MessageDigest md = MessageDigest.getInstance(algorithm);
File actualFile = new File(root, path); if (download(repo, digestPath)) { File digestFile = new File(root, digestPath); final MessageDigest md = MessageDigest.getInstance(algorithm);
if (download(url, pomPath)) { if (verify(url, pomPath)) { artifact = new FutureTask<File>(new Callable<File>() {
if (download(url, pomPath)) { if (verify(url, pomPath)) { artifact = new FutureTask<File>(new Callable<File>() {
if (download(url, pomPath)) { if (verify(url, pomPath)) { artifact = new FutureTask<File>(new Callable<File>() {
if (download(url, pomPath)) { if (verify(url, pomPath)) { artifact = new FutureTask<File>(new Callable<File>() {
if (download(url, pomPath)) { if (verify(url, pomPath)) { artifact = new FutureTask<>(new Callable<File>() {
if (download(url, pomPath)) { if (verify(url, pomPath)) { artifact = new FutureTask<>(new Callable<File>() {