public synchronized String addTemporaryDownload(HttpSession session, TemporaryFile file) {
String name = UIDGenerator.generateUID();
Map temporaryDownloads = (Map) session.getAttribute(SESSION_TEMPORARYDOWNLOADS);
if (temporaryDownloads == null) {
temporaryDownloads = new TransientMap(new HashMap());
session.setAttribute(SESSION_TEMPORARYDOWNLOADS, temporaryDownloads);
}
TemporaryDownload tempDownload = new TemporaryDownload(name, file);
temporaryDownloads.put(name, tempDownload);