long start = System.currentTimeMillis();
destFilePattern = IvyPatternHelper.substituteVariables(destFilePattern, _settings.getVariables());
String destIvyPattern = IvyPatternHelper.substituteVariables(options.getDestIvyPattern(), _settings.getVariables());
CacheManager cacheManager = getCacheManager(options);
String[] confs = getConfs(mrid, options);
Message.info("\tconfs: "+Arrays.asList(confs));
try {
Map artifactsToCopy = determineArtifactsToCopy(mrid, destFilePattern, options);
File fileRetrieveRoot = new File(IvyPatternHelper.getTokenRoot(destFilePattern));
File ivyRetrieveRoot = destIvyPattern == null ? null : new File(IvyPatternHelper.getTokenRoot(destIvyPattern));
Collection targetArtifactsStructure = new HashSet(); // Set(File) set of all paths which should be present at then end of retrieve (useful for sync)
Collection targetIvysStructure = new HashSet(); // same for ivy files
// do retrieve
int targetsCopied = 0;
int targetsUpToDate = 0;
for (Iterator iter = artifactsToCopy.keySet().iterator(); iter.hasNext();) {
Artifact artifact = (Artifact)iter.next();
File archive;
if ("ivy".equals(artifact.getType())) {
archive = cacheManager.getIvyFileInCache(artifact.getModuleRevisionId());
} else {
archive = cacheManager.getArchiveFileInCache(artifact,
cacheManager.getSavedArtifactOrigin(artifact), options.isUseOrigin());
if (!options.isUseOrigin() && !archive.exists()) {
// file is not available in cache, maybe the last resolve was performed with useOrigin=true.
// we try to use the best we can
archive = cacheManager.getArchiveFileInCache(artifact, cacheManager.getSavedArtifactOrigin(artifact));
}
}
Set dest = (Set)artifactsToCopy.get(artifact);
Message.verbose("\tretrieving "+archive);
for (Iterator it2 = dest.iterator(); it2.hasNext();) {