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 262073
Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java (-5 / +8 lines)
Lines 84-97 Link Here
84
			}
84
			}
85
			cacheFile.getParentFile().mkdirs();
85
			cacheFile.getParentFile().mkdirs();
86
			OutputStream metadata = new BufferedOutputStream(new FileOutputStream(cacheFile));
86
			OutputStream metadata = new BufferedOutputStream(new FileOutputStream(cacheFile));
87
			IStatus result;
87
			try {
88
			try {
88
				IStatus result = getTransport().download(remoteFile.toString(), metadata, monitor);
89
				result = getTransport().download(remoteFile.toString(), metadata, monitor);
89
				if (!result.isOK()) {
90
					throw new ProvisionException(result);
91
				}
92
			} finally {
90
			} finally {
93
				metadata.close();
91
				metadata.close();
94
			}
92
			}
93
			if (!result.isOK()) {
94
				//don't leave a partial cache file lying around
95
				cacheFile.delete();
96
				throw new ProvisionException(result);
97
			}
95
		}
98
		}
96
		return cacheFile;
99
		return cacheFile;
97
	}
100
	}
Lines 169-175 Link Here
169
			// cache is stale
172
			// cache is stale
170
			return true;
173
			return true;
171
		}
174
		}
172
		return lastModifiedRemote > lastModified ? true : false;
175
		return lastModifiedRemote > lastModified;
173
	}
176
	}
174
177
175
	/**
178
	/**

Return to bug 262073