Cipher symmetricCipher, Map<String, String> materialsDescription) {
ObjectMetadata metadata = request.getMetadata();
if (metadata == null) metadata = new ObjectMetadata();
if (request.getFile() != null) {
Mimetypes mimetypes = Mimetypes.getInstance();
metadata.setContentType(mimetypes.getMimetype(request.getFile()));
}
// Put the calculated length of the encrypted contents in the metadata
long cryptoContentLength = calculateCryptoContentLength(symmetricCipher, request, metadata);
if (cryptoContentLength > 0) metadata.setContentLength(cryptoContentLength);