Package org.olat.core.util.vfs

Examples of org.olat.core.util.vfs.VFSContainer.copyFrom()


    VFSLeaf fVersions = getCanonicalVersionXmlFile(currentFile, true);
    Versions versions = readVersions(currentFile, fVersions);

    VFSContainer versionContainer = getCanonicalVersionFolder(container, true);

    boolean allOk = VFSConstants.YES.equals(versionContainer.copyFrom(fVersions));
    for (VFSRevision revision : versions.getRevisions()) {
      RevisionFileImpl revisionImpl = (RevisionFileImpl) revision;
      VFSLeaf revisionFile = revisionImpl.getFile();
      if (revisionFile != null) {
        allOk &= VFSConstants.YES.equals(versionContainer.copyFrom(revisionFile));
View Full Code Here


    boolean allOk = VFSConstants.YES.equals(versionContainer.copyFrom(fVersions));
    for (VFSRevision revision : versions.getRevisions()) {
      RevisionFileImpl revisionImpl = (RevisionFileImpl) revision;
      VFSLeaf revisionFile = revisionImpl.getFile();
      if (revisionFile != null) {
        allOk &= VFSConstants.YES.equals(versionContainer.copyFrom(revisionFile));
      }
    }

    allOk &= VFSConstants.YES.equals(fVersions.delete());
    for (VFSRevision revision : versions.getRevisions()) {
View Full Code Here

          if(vfsSource instanceof VFSLeaf && targetFile != null && targetFile instanceof Versionable
              && ((Versionable)targetFile).getVersions().isVersioned()) {
            //add a new version to the file
            ((Versionable)targetFile).getVersions().addVersion(null, "", ((VFSLeaf)vfsSource).getInputStream());
          } else {
            vfsStatus = target.copyFrom(vfsSource);
          }
          if (vfsStatus != VFSConstants.SUCCESS) {
            String errorKey = "failed";
            if (vfsStatus == VFSConstants.ERROR_QUOTA_EXCEEDED)
              errorKey = "QuotaExceeded";
View Full Code Here

          wikiCtn.copyFrom(leaf);
        } else {
          if (leaf.getName().contains(WikiManager.WIKI_FILE_SUFFIX+"-") || leaf.getName().contains(WikiManager.WIKI_PROPERTIES_SUFFIX+"-")) {
            leaf.delete(); // delete version history
          } else
          mediaCtn.copyFrom(leaf);
        }
      }
      unzippedDir.delete();
      List zipFiles = rootContainer.getItems(new VFSItemSuffixFilter(new String[] { "zip" }));
      // delete all zips
View Full Code Here

        // Copy the feed image to the repository home folder unless it was
        // deleted.
        String feedImage = feed.getImageName();
        if (feedImage != null) {
          VFSItem newImage = getFeedMediaContainer(feed).resolve(feedImage);
          repoHome.copyFrom(newImage);
          VFSItem newEntryImage = repoHome.resolve(feed.getImageName());
          newEntryImage.rename(imageFilename);
        }
      }
    }
View Full Code Here

      String saveFileName = getSaveFileName(file.getUploadFileName());

      File renamed = new File(uploadedFile.getParent() + "/" + saveFileName);
      uploadedFile.renameTo(renamed);
      VFSLeaf mediaFile = new LocalFileImpl(renamed);
      itemMediaContainer.copyFrom(mediaFile);

      // Update the enclosure
      Enclosure enclosure = new Enclosure();
      enclosure.setFileName(saveFileName);
      enclosure.setLength(renamed.length());
View Full Code Here

      VFSItem item = container.resolve("attachments");
      if (item == null){
        item = container.createChildContainer("attachments");
      }
      VFSContainer attachmentContainer = (VFSContainer)item;
      attachmentContainer.copyFrom(msgContainer);
     
      sb.append("{\\pard \\f0\\fs15 Attachment(s): ");
      boolean commaFlag = false;
      for (Iterator iter = attachments.iterator(); iter.hasNext();) {
        VFSItem attachment = (VFSItem) iter.next();
View Full Code Here

    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH_mm_ss_SSS");
    String exportDirName = getShortTitle()+"_"+element.getForumKey()+"_"+formatter.format(new Date(System.currentTimeMillis()));
    VFSContainer diaNodeElemExportContainer = exportContainer.createChildContainer(exportDirName);
    // don't check quota
    diaNodeElemExportContainer.setLocalSecurityCallback(new FullAccessCallback());
    diaNodeElemExportContainer.copyFrom(dialogFile);

    ForumArchiveManager fam = ForumArchiveManager.getInstance();
    ForumFormatter ff = new ForumRTFFormatter(diaNodeElemExportContainer, false);
    fam.applyFormatter(ff, element.getForumKey().longValue(), null);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.