if ((pkgDetails != null) && ((pkgDetails.getSHA256() == null) || (pkgDetails.getSHA256().trim().length() == 0))) {
InputStream is;
try {
is = contentManager.performGetPackageBits(request.getResourceId(), request.getPackageDetails());
try {
pkgDetails.setSHA256(new MessageDigestGenerator(MessageDigestGenerator.SHA_256)
.calcDigestString(is));
} finally {
is.close();
}
} catch (Exception e) {
log.warn("Error calculating SHA256 [" + request.getRequestId() + "][" + request.getPackageDetails()
+ "]", e);
}
}
if ((pkgDetails != null) && ((pkgDetails.getMD5() == null) || (pkgDetails.getMD5().trim().length() == 0))) {
InputStream is;
try {
is = contentManager.performGetPackageBits(request.getResourceId(), request.getPackageDetails());
try {
pkgDetails.setMD5((new MessageDigestGenerator(MessageDigestGenerator.MD5).calcDigestString(is)));
} finally {
is.close();
}
} catch (Exception e) {
log.warn("Error calculating MD5 [" + request.getRequestId() + "][" + request.getPackageDetails()