final Artifact pArtifact) throws IOException {
if (pArtifact.isComplete())
download(pPomUrl, pRemoteRepo, pArtifact.getRelativePath(true));
else {
final ChildrenFetchService service = ChildrenFetchService.getInstance();
final RepoPathElement elt = pArtifact.toRepoPathElement(pRemoteRepo);
final ProgressIndicator prg = IDEUtils.getProgressIndicator();
if (prg != null) {
if (prg.isCanceled())
return;
prg.setText2("Searching for children of '" + elt.getRelativeURIPath() + "'...");
}
final Future<RepoPathElement[]> result = service.fetch(elt);
try {
final RepoPathElement[] elements = result.get(30, TimeUnit.SECONDS);
if (prg != null)
prg.setText2("Found " + elements.length + " artifacts under '" + elt.getRelativeURIPath() + "', downloading...");
for (int i = 0; i < elements.length; i++) {
RepoPathElement element = elements[i];
if (prg != null) {
if (prg.isCanceled())
return;
prg.setText2("Download artifact " + (i + 1) + " out of " + elements.length + " for " + elt.getRelativeURIPath());
}