use of org.apache.ivy.core.resolve.DownloadOptions in project ant-ivy by apache.
the class AbstractResolver method locate.
/**
* Default implementation actually download the artifact Subclasses should overwrite this to
* avoid the download
*
* @param artifact ArtifactOrigin
* @return ArtifactOrigin
*/
public ArtifactOrigin locate(Artifact artifact) {
DownloadReport dr = download(new Artifact[] { artifact }, new DownloadOptions());
if (dr == null) {
/*
* according to IVY-831, it seems that this actually happen sometime, while the
* contract of DependencyResolver says that it should never return null
*/
throw new IllegalStateException("null download report returned by " + getName() + " (" + getClass().getName() + ")" + " when trying to download " + artifact);
}
ArtifactDownloadReport adr = dr.getArtifactReport(artifact);
return adr.getDownloadStatus() == DownloadStatus.FAILED ? null : adr.getArtifactOrigin();
}
Aggregations