Ejemplo n.º 1
0
  public void archiveWiki(final OLATResourceable ores, final String archivFilePath) {
    final VFSContainer wikiContainer = WikiManager.getInstance().getWikiRootContainer(ores);
    final VFSLeaf wikiZip = WikiToZipUtils.getWikiAsZip(wikiContainer);
    final String exportFileName = "del_wiki_" + ores.getResourceableId() + ".zip";
    final File archiveDir = new File(archivFilePath);
    if (!archiveDir.exists()) {
      archiveDir.mkdir();
    }
    final String fullFilePath = archivFilePath + File.separator + exportFileName;

    try {
      FileUtils.bcopy(wikiZip.getInputStream(), new File(fullFilePath), "archive wiki");
    } catch (final FileNotFoundException e) {
      log.warn("Can not archive wiki repoEntry=" + ores.getResourceableId());
    } catch (final IOException ioe) {
      log.warn("Can not archive wiki repoEntry=" + ores.getResourceableId());
    }
  }