unmar.setWhitespacePreserve(true);
unmar.setValidation(false);
} catch (MappingException e1) {
e1.printStackTrace();
}
UpdateCollection coll = new UpdateCollection();
try {
coll =
(UpdateCollection) unmar.unmarshal(
new InputSource(
new FileReader(path + "installed.xml")));
} catch (MarshalException e2) {
e2.printStackTrace();
} catch (ValidationException e2) {
e2.printStackTrace();
} catch (FileNotFoundException e2) {
logger.info("No previous installations");
}
// Find the update with id updatePackageId
Iterator iterator = coll.getUpdatePackageList().iterator();
while (iterator.hasNext()) {
UpdatePackage u = (UpdatePackage) iterator.next();
if(upd.getPackageId().compareTo(u.getPackageId())==0)
{
coll.getUpdatePackageList().remove(u);
iterator = coll.getUpdatePackageList().iterator();
}
}