if (minutes.getAuthor().equals(currentUser) == false) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return null;
}
// TSV 作成と削除をする
BlobKey blobKey = MinutesService.exportAsTSV(minutes);
MinutesService.deleteMinutes(minutes);
// ダウンロードURL をメールで送信する
Message message = new Message();
message.setSender("minutes@yourappid.appspotmail.com");
message.setSubject(" 議事録[" + minutes.getTitle() + "] がTSV に変換されました");
message.setTo(currentUser.getEmail());
StringBuilder b = new StringBuilder();
b
.append(request.getScheme())
.append("://")
.append(request.getServerName());
if (request.getServerPort() != 80) {
b.append(":").append(request.getServerPort());
}
b.append("/minutes?download=").append(blobKey.getKeyString());
message.setTextBody(b.toString());
MailService mailService = MailServiceFactory.getMailService();
mailService.send(message);
response.setStatus(HttpServletResponse.SC_NO_CONTENT);
return null;