@Override public String archive(final String archivFilePath, final RepositoryEntry repoEntry) { final String exportFileName = "del_glossar_" + repoEntry.getOlatResource().getResourceableId() + ".zip"; final String fullFilePath = archivFilePath + File.separator + exportFileName; final File fExportZIP = new File(fullFilePath); final VFSContainer glossaryRoot = getGlossaryRootFolder(repoEntry.getOlatResource()); ZipUtil.zip(glossaryRoot.getItems(), new LocalFileImpl(fExportZIP), true); return fullFilePath; }
/** * Export the glossary as a media resource. The resource name is set to the resources display name * * @param res * @return */ @Override public MediaResource getAsMediaResource(final OLATResourceable res) { final RepositoryEntry repoEntry = RepositoryServiceImpl.getInstance().lookupRepositoryEntry(res, false); final String exportFileName = repoEntry.getDisplayname() + ".zip"; final File fExportZIP = new File(FolderConfig.getCanonicalTmpDir() + "/" + exportFileName); final VFSContainer glossaryRoot = getGlossaryRootFolder(res); ZipUtil.zip(glossaryRoot.getItems(), new LocalFileImpl(fExportZIP), false); return new CleanupAfterDeliveryFileMediaResource(fExportZIP); }