if (isDynamic) {
nsMd.setResolvedModuleRevisionId(ModuleRevisionId.newInstance(nsMrid,
artifactRef.getRevision()));
}
systemMd = toSystem(nsMd);
MetadataArtifactDownloadReport madr =
new MetadataArtifactDownloadReport(systemMd.getMetadataArtifact());
madr.setDownloadStatus(DownloadStatus.NO);
madr.setSearched(true);
rmr = new ResolvedModuleRevision(this, this, systemMd, madr);
}
} else {
if (ivyRef instanceof MDResolvedResource) {
rmr = ((MDResolvedResource) ivyRef).getResolvedModuleRevision();
}
if (rmr == null) {
rmr = parse(ivyRef, systemDd, data);
if (rmr == null) {
return null;
}
}
if (!rmr.getReport().isDownloaded()) {
return toSystem(rmr);
} else {
nsMd = rmr.getDescriptor();
parser = ModuleDescriptorParserRegistry.getInstance().getParser(
ivyRef.getResource());
// check descriptor data is in sync with resource revision and names
systemMd = toSystem(nsMd);
if (checkconsistency) {
checkDescriptorConsistency(systemMrid, systemMd, ivyRef);
checkDescriptorConsistency(nsMrid, nsMd, ivyRef);
} else {
if (systemMd instanceof DefaultModuleDescriptor) {
String revision = getRevision(ivyRef, systemMrid, systemMd);
((DefaultModuleDescriptor) systemMd).setModuleRevisionId(
ModuleRevisionId.newInstance(systemMrid, revision));
} else {
Message.warn(
"consistency disabled with instance of non DefaultModuleDescriptor..."
+ " module info can't be updated, so consistency check will be done");
checkDescriptorConsistency(nsMrid, nsMd, ivyRef);
checkDescriptorConsistency(systemMrid, systemMd, ivyRef);
}
}
MetadataArtifactDownloadReport madr =
new MetadataArtifactDownloadReport(systemMd.getMetadataArtifact());
madr.setDownloadStatus(rmr.getReport().getDownloadStatus());
madr.setDownloadDetails(rmr.getReport().getDownloadDetails());
madr.setArtifactOrigin(rmr.getReport().getArtifactOrigin());
madr.setDownloadTimeMillis(rmr.getReport().getDownloadTimeMillis());
madr.setSize(rmr.getReport().getSize());
madr.setOriginalLocalFile(rmr.getReport().getOriginalLocalFile());
madr.setSearched(true);
rmr = new ResolvedModuleRevision(this, this, systemMd, madr);
}
}
// resolve revision