AttachmentMetadata metadata = getMetadata(id);
if (metadata == null) {
throw NotFoundException.withInternalMessage("Attachment id unknown: " + id);
}
BlobKey key = metadata.getBlobKey();
BlobInfo info = new BlobInfoFactory().loadBlobInfo(key);
String disposition = "attachment; filename=\""
// TODO(ohler): Investigate what escaping we need here, and whether the
// blobstore service has already done some escaping that we need to undo
// (it seems to do percent-encoding on " characters).
+ info.getFilename().replace("\"", "\\\"").replace("\\", "\\\\")