Package org.olat.core.util.vfs

Examples of org.olat.core.util.vfs.VFSLeaf.rename()


  public boolean rename(VFSItem item, String newname) {
    if (item instanceof VFSLeaf) {
      VFSLeaf currentFile = (VFSLeaf) item;
      VFSLeaf versionFile = getCanonicalVersionXmlFile(currentFile, true);
      // infinite loop if rename is own versions file
      return VFSConstants.YES.equals(versionFile.rename(newname + ".xml"));
    } else if (item instanceof VFSContainer) {
      VFSContainer container = (VFSContainer) item;
      VFSContainer versionContainer = getCanonicalVersionFolder(container, false);
      if (versionContainer == null) { return true; }
      return VFSConstants.YES.equals(versionContainer.rename(newname));
View Full Code Here


          if (!page.getPageId().equals(idOutOfFileName)) {
            // rename corrupt prop file
            propertiesFile.rename(page.getPageId() + "." + WikiManager.WIKI_PROPERTIES_SUFFIX);
            // load content and delete corrupt content file
            VFSLeaf contentFile = (VFSLeaf) folder.resolve(idOutOfFileName + "." + WikiManager.WIKI_FILE_SUFFIX);
            contentFile.rename(page.getPageId() + "." + WikiManager.WIKI_FILE_SUFFIX);
          }

          wiki.addPage(page);
        }
        // if index and menu page not present create the first page and save it
View Full Code Here

      CPManager.getInstance().writeToFile(cp);

    } else {
      // Single file
      VFSLeaf uploadedItem = new LocalFileImpl(file.getUploadFile());
      uploadedItem.rename(file.getUploadFileName());
      // rename to unique name in root folder
      renameToNonExistingDesignation(root, uploadedItem);
      // move item to root folder
      root.copyFrom(uploadedItem);
      pageToBeSelected = addItem(uploadedItem, currentPage.getIdentifier(), false);
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.