}
public MediaResource getAsMediaResource(OLATResourceable res) {
String exportFileName = res.getResourceableId() + ".zip";
File fExportZIP = new File(FolderConfig.getCanonicalTmpDir() + "/" + exportFileName);
VFSContainer sharedFolder = SharedFolderManager.getInstance().getSharedFolder(res);
//OLAT-5368: do intermediate commit to avoid transaction timeout
// discussion intermediatecommit vs increased transaction timeout:
// pro intermediatecommit: not much
// pro increased transaction timeout: would fix OLAT-5368 but only move the problem
//@TODO OLAT-2597: real solution is a long-running background-task concept...
DBFactory.getInstance().intermediateCommit();
ZipUtil.zip(sharedFolder.getItems(), new LocalFileImpl(fExportZIP));
return new CleanupAfterDeliveryFileMediaResource(fExportZIP);
}