private void localizeOneResource(String fqfn, URI srcUri, ResourceType rt, FnResources result) throws URISyntaxException, IOException { RefCountedResource rcr = localFiles.get(srcUri); if (rcr != null && rcr.refCount > 0) { logFilesUsed("Reusing", fqfn, srcUri, rcr); ++rcr.refCount; result.addResources(rcr); return; } rcr = new RefCountedResource(); List<URI> localUris = resourceDownloader.downloadExternal(srcUri, fqfn, false); if (localUris == null || localUris.isEmpty()) { LOG.error("Cannot download " + srcUri + " for " + fqfn); return; } rcr.resources = new ArrayList<>(); for (URI uri : localUris) { // Reuse the same type for all. Only Ivy can return more than one, probably all jars. String path = uri.getPath(); rcr.resources.add(new FunctionResource(rt, path)); if (rt == ResourceType.JAR) { recentlyLocalizedJars.add(path); } } ++rcr.refCount; logFilesUsed("Using", fqfn, srcUri, rcr); localFiles.put(srcUri, rcr); result.addResources(rcr); }
List<URI> localUris = resourceDownloader.downloadExternal(srcUri, null, false); for(URI dst : localUris) { LOG.warn("Downloaded " + dst + " from " + srcUri);
private void localizeOneResource(String fqfn, URI srcUri, ResourceType rt, FnResources result) throws URISyntaxException, IOException { RefCountedResource rcr = localFiles.get(srcUri); if (rcr != null && rcr.refCount > 0) { logFilesUsed("Reusing", fqfn, srcUri, rcr); ++rcr.refCount; result.addResources(rcr); return; } rcr = new RefCountedResource(); List<URI> localUris = resourceDownloader.downloadExternal(srcUri, fqfn, false); if (localUris == null || localUris.isEmpty()) { LOG.error("Cannot download " + srcUri + " for " + fqfn); return; } rcr.resources = new ArrayList<>(); for (URI uri : localUris) { // Reuse the same type for all. Only Ivy can return more than one, probably all jars. String path = uri.getPath(); rcr.resources.add(new FunctionResource(rt, path)); if (rt == ResourceType.JAR) { recentlyLocalizedJars.add(path); } } ++rcr.refCount; logFilesUsed("Using", fqfn, srcUri, rcr); localFiles.put(srcUri, rcr); result.addResources(rcr); }
List<URI> localUris = resourceDownloader.downloadExternal(srcUri, null, false); for(URI dst : localUris) { LOG.warn("Downloaded " + dst + " from " + srcUri);