|
Lines 244-257
Link Here
|
| 244 |
*/ |
244 |
*/ |
| 245 |
public long getDownloadSizeFor(IFeature feature) { |
245 |
public long getDownloadSizeFor(IFeature feature) { |
| 246 |
long result = 0; |
246 |
long result = 0; |
| 247 |
IPluginEntry[] entriesToInstall = feature.getPluginEntries(); |
247 |
|
| 248 |
IPluginEntry[] siteEntries = this.getPluginEntries(); |
|
|
| 249 |
entriesToInstall = UpdateManagerUtils.diff(entriesToInstall, siteEntries); |
| 250 |
//[18355] |
| 251 |
INonPluginEntry[] nonPluginEntriesToInstall = feature.getNonPluginEntries(); |
| 252 |
|
| 253 |
try { |
248 |
try { |
| 254 |
result = feature.getFeatureContentProvider().getDownloadSizeFor(entriesToInstall, nonPluginEntriesToInstall); |
249 |
IFeatureReference[] children = feature.getIncludedFeatureReferences(); |
|
|
250 |
IFeature currentFeature = null; |
| 251 |
for (int i = 0; i < children.length; i++) { |
| 252 |
currentFeature = children[i].getFeature(null); |
| 253 |
if (currentFeature != null) { |
| 254 |
result += getDownloadSizeFor(currentFeature); |
| 255 |
if(result == ContentEntryModel.UNKNOWN_SIZE) |
| 256 |
return result; |
| 257 |
} |
| 258 |
} |
| 259 |
|
| 260 |
IPluginEntry[] entriesToInstall = feature.getPluginEntries(); |
| 261 |
IPluginEntry[] siteEntries = this.getPluginEntries(); |
| 262 |
entriesToInstall = UpdateManagerUtils.diff(entriesToInstall, siteEntries); |
| 263 |
//[18355] |
| 264 |
INonPluginEntry[] nonPluginEntriesToInstall = feature.getNonPluginEntries(); |
| 265 |
|
| 266 |
result += feature.getFeatureContentProvider().getDownloadSizeFor(entriesToInstall, nonPluginEntriesToInstall); |
| 255 |
} catch (CoreException e) { |
267 |
} catch (CoreException e) { |
| 256 |
UpdateCore.warn(null, e); |
268 |
UpdateCore.warn(null, e); |
| 257 |
result = ContentEntryModel.UNKNOWN_SIZE; |
269 |
result = ContentEntryModel.UNKNOWN_SIZE; |
|
Lines 283-289
Link Here
|
| 283 |
for (int i = 0; i < children.length; i++) { |
295 |
for (int i = 0; i < children.length; i++) { |
| 284 |
currentFeature = children[i].getFeature(null); |
296 |
currentFeature = children[i].getFeature(null); |
| 285 |
if (currentFeature != null) { |
297 |
if (currentFeature != null) { |
| 286 |
pluginsToInstall.addAll(Arrays.asList(currentFeature.getPluginEntries())); |
298 |
result += getInstallSizeFor(currentFeature); |
|
|
299 |
if(result == ContentEntryModel.UNKNOWN_SIZE) |
| 300 |
return result; |
| 287 |
} |
301 |
} |
| 288 |
} |
302 |
} |
| 289 |
|
303 |
|
|
Lines 299-305
Link Here
|
| 299 |
//[18355] |
313 |
//[18355] |
| 300 |
INonPluginEntry[] nonPluginEntriesToInstall = feature.getNonPluginEntries(); |
314 |
INonPluginEntry[] nonPluginEntriesToInstall = feature.getNonPluginEntries(); |
| 301 |
|
315 |
|
| 302 |
result = feature.getFeatureContentProvider().getInstallSizeFor(entriesToInstall, nonPluginEntriesToInstall); |
316 |
result += feature.getFeatureContentProvider().getInstallSizeFor(entriesToInstall, nonPluginEntriesToInstall); |
| 303 |
} catch (CoreException e) { |
317 |
} catch (CoreException e) { |
| 304 |
UpdateCore.warn(null, e); |
318 |
UpdateCore.warn(null, e); |
| 305 |
result = ContentEntryModel.UNKNOWN_SIZE; |
319 |
result = ContentEntryModel.UNKNOWN_SIZE; |