// Fetch the checksum directly from the manager and return it. If we
// cannot find the factory to handle the content assets, then return
// an error (this should never happen).
ChecksumManager checksumManager = ChecksumManager.getChecksumManager();
ContentAssetDescriptor cad = new ContentAssetDescriptor(contentRoot, assetPath);
ChecksumFactory checksumFactory = checksumManager.getChecksumFactory(cad);
if (checksumFactory == null) {
logger.warning("Unable to find checksum factory for " + cad);
return Response.noContent().build();
}
// Ask the factory for the asset. If it does not exist, then ask it to
// create the checksum
ChecksumList checksumList = checksumFactory.getChecksumList(cad, ChecksumAction.GENERATE);
if (checksumList == null) {
logger.warning("Unable to generate checksum for " + contentRoot +
" " + assetPath);
return Response.noContent().build();
}