public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { return delegate.getRawArtifact(descriptor, destination, monitor); }
public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { return innerRepo.getRawArtifact(descriptor, destination, monitor); }
@Override protected IStatus getArtifact(IArtifactDescriptor artifactDescriptor, OutputStream destination, IProgressMonitor monitor) { if (SimpleArtifactRepository.CHECKSUMS_ENABLED) { Collection<ProcessingStep> steps = ChecksumUtilities.getChecksumVerifiers(artifactDescriptor, IArtifactDescriptor.DOWNLOAD_CHECKSUM, Collections.emptySet()); ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]); // TODO should probably be using createAndLink here ProcessingStepHandler handler = new ProcessingStepHandler(); destination = handler.link(stepArray, destination, monitor); } return getSourceRepository().getRawArtifact(artifactDescriptor, destination, monitor); } }
private IStatus getRawOrNormalArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor, boolean raw) { for (Iterator<ChildInfo> childIterator = loadedRepos.iterator(); childIterator.hasNext();) { ChildInfo current = childIterator.next(); if (current.isGood() && current.repo.contains(descriptor)) { // Child hasn't failed & contains descriptor IStatus status = raw ? current.repo.getRawArtifact(descriptor, destination, monitor) : current.repo.getArtifact(descriptor, destination, monitor); if (status.isOK()) { //we are done with this artifact so forgive bad children so they can try again on next artifact resetChildFailures(); return Status.OK_STATUS; } // Download failed if (status.getCode() == CODE_RETRY || status.getCode() == IStatus.CANCEL) // Child has mirrors & wants to be retried, or we were canceled return status; // Child has failed us, mark it bad current.setBad(true); // If more children are available, set retry if (childIterator.hasNext()) return new MultiStatus(Activator.ID, CODE_RETRY, new IStatus[] {status}, NLS.bind(Messages.retryRequest, descriptor.getArtifactKey(), current.repo.getLocation()), null); // Nothing that can be done, pass child's failure on resetChildFailures(); return status; } if (monitor.isCanceled()) return Status.CANCEL_STATUS; } return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.artifact_not_found, descriptor)); }
private IStatus getRawOrNormalArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor, boolean raw) { for (Iterator<ChildInfo> childIterator = loadedRepos.iterator(); childIterator.hasNext();) { ChildInfo current = childIterator.next(); if (current.isGood() && current.repo.contains(descriptor)) { // Child hasn't failed & contains descriptor IStatus status = raw ? current.repo.getRawArtifact(descriptor, destination, monitor) : current.repo.getArtifact(descriptor, destination, monitor); if (status.isOK()) { //we are done with this artifact so forgive bad children so they can try again on next artifact resetChildFailures(); return Status.OK_STATUS; } // Download failed if (status.getCode() == CODE_RETRY || status.getCode() == IStatus.CANCEL) // Child has mirrors & wants to be retried, or we were canceled return status; // Child has failed us, mark it bad current.setBad(true); // If more children are available, set retry if (childIterator.hasNext()) return new MultiStatus(Activator.ID, CODE_RETRY, new IStatus[] {status}, NLS.bind(Messages.retryRequest, descriptor.getArtifactKey(), current.repo.getLocation()), null); // Nothing that can be done, pass child's failure on resetChildFailures(); return status; } if (monitor.isCanceled()) return Status.CANCEL_STATUS; } return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.artifact_not_found, descriptor)); }
private IStatus getRawOrNormalArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor, boolean raw) { for (Iterator<ChildInfo> childIterator = loadedRepos.iterator(); childIterator.hasNext();) { ChildInfo current = childIterator.next(); if (current.isGood() && current.repo.contains(descriptor)) { // Child hasn't failed & contains descriptor IStatus status = raw ? current.repo.getRawArtifact(descriptor, destination, monitor) : current.repo.getArtifact(descriptor, destination, monitor); if (status.isOK()) { //we are done with this artifact so forgive bad children so they can try again on next artifact resetChildFailures(); return Status.OK_STATUS; } // Download failed if (status.getCode() == CODE_RETRY || status.getCode() == IStatus.CANCEL) // Child has mirrors & wants to be retried, or we were canceled return status; // Child has failed us, mark it bad current.setBad(true); // If more children are available, set retry if (childIterator.hasNext()) return new MultiStatus(Activator.ID, CODE_RETRY, new IStatus[] {status}, NLS.bind(Messages.retryRequest, descriptor.getArtifactKey(), current.repo.getLocation()), null); // Nothing that can be done, pass child's failure on resetChildFailures(); return status; } if (monitor.isCanceled()) return Status.CANCEL_STATUS; } return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.artifact_not_found, descriptor)); }
private IStatus getRawOrNormalArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor, boolean raw) { for (Iterator<ChildInfo> childIterator = loadedRepos.iterator(); childIterator.hasNext();) { ChildInfo current = childIterator.next(); if (current.isGood() && current.repo.contains(descriptor)) { // Child hasn't failed & contains descriptor IStatus status = raw ? current.repo.getRawArtifact(descriptor, destination, monitor) : current.repo.getArtifact(descriptor, destination, monitor); if (status.isOK()) { //we are done with this artifact so forgive bad children so they can try again on next artifact resetChildFailures(); return Status.OK_STATUS; } // Download failed if (status.getCode() == CODE_RETRY || status.getCode() == IStatus.CANCEL) // Child has mirrors & wants to be retried, or we were canceled return status; // Child has failed us, mark it bad current.setBad(true); // If more children are available, set retry if (childIterator.hasNext()) return new MultiStatus(Activator.ID, CODE_RETRY, new IStatus[] {status}, NLS.bind(Messages.retryRequest, descriptor.getArtifactKey(), current.repo.getLocation()), null); // Nothing that can be done, pass child's failure on resetChildFailures(); return status; } if (monitor.isCanceled()) return Status.CANCEL_STATUS; } return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.artifact_not_found, descriptor)); }
protected IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { ProcessingStepHandler handler = new ProcessingStepHandler(); if (SimpleArtifactRepository.MD5_CHECK_ENABLED && descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_MD5) != null) destination = handler.link(new ProcessingStep[] {new MD5Verifier(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_MD5))}, destination, monitor); return getSourceRepository().getRawArtifact(descriptor, destination, monitor); } }
protected IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { ProcessingStepHandler handler = new ProcessingStepHandler(); if (SimpleArtifactRepository.MD5_CHECK_ENABLED && descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_MD5) != null) destination = handler.link(new ProcessingStep[] {new MD5Verifier(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_MD5))}, destination, monitor); return getSourceRepository().getRawArtifact(descriptor, destination, monitor); } }
protected IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { ProcessingStepHandler handler = new ProcessingStepHandler(); if (SimpleArtifactRepository.MD5_CHECK_ENABLED && descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_MD5) != null) destination = handler.link(new ProcessingStep[] {new MD5Verifier(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_MD5))}, destination, monitor); return getSourceRepository().getRawArtifact(descriptor, destination, monitor); } }