Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 236157 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java (-2 / +4 lines)
Lines 399-404 Link Here
399
	protected IStatus downloadArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
399
	protected IStatus downloadArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
400
		if (isFolderBased(descriptor)) {
400
		if (isFolderBased(descriptor)) {
401
			File artifactFolder = getArtifactFile(descriptor);
401
			File artifactFolder = getArtifactFile(descriptor);
402
			if (artifactFolder == null)
403
				return reportStatus(descriptor, destination, new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.artifact_not_found, descriptor.getArtifactKey())));
402
			// TODO: optimize and ensure manifest is written first
404
			// TODO: optimize and ensure manifest is written first
403
			File zipFile = null;
405
			File zipFile = null;
404
			try {
406
			try {
Lines 407-418 Link Here
407
				FileInputStream fis = new FileInputStream(zipFile);
409
				FileInputStream fis = new FileInputStream(zipFile);
408
				FileUtils.copyStream(fis, true, destination, false);
410
				FileUtils.copyStream(fis, true, destination, false);
409
			} catch (IOException e) {
411
			} catch (IOException e) {
410
				return new Status(IStatus.ERROR, Activator.ID, e.getMessage());
412
				return reportStatus(descriptor, destination, new Status(IStatus.ERROR, Activator.ID, e.getMessage()));
411
			} finally {
413
			} finally {
412
				if (zipFile != null)
414
				if (zipFile != null)
413
					zipFile.delete();
415
					zipFile.delete();
414
			}
416
			}
415
			return Status.OK_STATUS;
417
			return reportStatus(descriptor, destination, Status.OK_STATUS);
416
		}
418
		}
417
419
418
		//download from the best available mirror
420
		//download from the best available mirror

Return to bug 236157