Examples of OlatRootFolderImpl


Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

   */
  public static List<FileInfo> getFileInfos(final String olatRelPath, Date newerThan) {
   
    final List<FileInfo> fileInfos = new ArrayList<FileInfo>();
    final long newerThanLong = newerThan.getTime();
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(olatRelPath, null);
    getFileInfosRecursively(rootFolder, fileInfos, newerThanLong, olatRelPath.length());
    return fileInfos;
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

        String bcRelPath = bcrootPath.substring(basePathlen);
        fileInfos.add(new FileInfo(bcRelPath, meta, new Date(lastModified)));
      }
    } else {
      // is a folder
      OlatRootFolderImpl container = (OlatRootFolderImpl)relPath;
      for (VFSItem item : container.getItems()) {
        getFileInfosRecursively((OlatRelPathImpl)item, fileInfos, newerThan, basePathlen);
      }
    }
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

  public VFSContainer getContainer(Identity identity) {
    // merge /public and /private
    MergeSource homeMergeSource = new MergeSource(null, identity.getName());
   
    // mount /public
    OlatRootFolderImpl vfsPublic = new OlatRootFolderImpl(getRootPathFor(identity) + "/public", homeMergeSource);
    vfsPublic.getBasefile().mkdirs(); // lazy initialize folders
    // we do a little trick here and wrap it again in a NamedContainerImpl so
    // it doesn't show up as a OlatRootFolderImpl to prevent it from editing its MetaData
    OlatNamedContainerImpl vfsNamedPublic = new OlatNamedContainerImpl("public", vfsPublic);
   
    // mount /private
    OlatRootFolderImpl vfsPrivate = new OlatRootFolderImpl(getRootPathFor(identity) + "/private", homeMergeSource);
    vfsPrivate.getBasefile().mkdirs(); // lazy initialize folders
    // we do a little trick here and wrap it again in a NamedContainerImpl so
    // it doesn't show up as a OlatRootFolderImpl to prevent it from editing its MetaData
    OlatNamedContainerImpl vfsNamedPrivate = new OlatNamedContainerImpl("private", vfsPrivate);
   
    // set quota for this merge source
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

    if(log.isDebug()){
      log.debug("calculating wiki root container with ores id: "+ores.getResourceableId()+" and resourcable type name: "+ores.getResourceableTypeName());
    }
    if (isGroupContextWiki(ores)) {
      // Group Wiki
      return new OlatRootFolderImpl(getGroupWikiRelPath(ores), null);
    } else {
      // Repository Wiki
      return FileResourceManager.getInstance().getFileResourceRootImpl(ores);
    }
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

   */
  public OlatRootFolderImpl getMediaFolder(OLATResourceable ores) {
    // Check if Resource is a BusinessGroup, because BusinessGroup-wiki's are stored at a different place
    if (isGroupContextWiki(ores)) {
      // Group Wiki
      return new OlatRootFolderImpl(getGroupWikiRelPath(ores) + "/" + WikiContainer.MEDIA_FOLDER_NAME, null);
    } else {
      // Repository Wiki 
      return new OlatRootFolderImpl("/repository/" + ores.getResourceableId() + "/" + WikiContainer.MEDIA_FOLDER_NAME,  null);
    }
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

    super(name);
    this.ores = ores;
    this.minHeight = Math.max(minHeight, 15);
   
    //configure wiki parser
    OlatRootFolderImpl tempFolder =  new OlatRootFolderImpl("/tmp", null);
    Environment.setValue(Environment.PROP_BASE_FILE_DIR, tempFolder.getBasefile().getAbsolutePath());
    Environment.setValue(Environment.PROP_DB_TYPE, "org.olat.core.gui.components.wikiToHtml.OlatWikiDataHandler");
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

    super(ureq, control, FormBasicController.LAYOUT_VERTICAL);
    this.forumCallback = forumCallback;
    this.message = message;
    this.fm = ForumManager.getInstance();

    tempUploadFolder = new OlatRootFolderImpl(File.separator + "tmp/" + CodeHelper.getGlobalForeverUniqueID() + "/", null);
    // nfs creates .nfs12345 - files during deletion, those shouldn't be displayed / copied after save
    // See OLAT-4182 and OLAT-4219
    exclFilter = new VFSItemExcludePrefixFilter(ATTACHMENT_EXCLUDE_PREFIXES);
   
    // decide which mode is used
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

    FormItem attachLayout = formLayout.getFormComponent("attachLayout");

    List<VFSItem> attachments = new ArrayList<VFSItem>();
    // add already existing attachments:
    if (message.getKey() != null) {
      OlatRootFolderImpl msgContainer = fm.getMessageContainer(message.getForum().getKey(), message.getKey());
      attachments.addAll(msgContainer.getItems(exclFilter));
    }
    // add files from TempFolder
    attachments.addAll(getTempFolderFileList());
   
    Collections.sort(attachments, new Comparator(){
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

          boolean fileExists = false;
          if (getTempFolderFileList().contains(fileName)) {
            fileExists = true;
          }
          if (message.getKey() != null) {
            OlatRootFolderImpl msgContainer = fm.getMessageContainer(message.getForum().getKey(), message.getKey());
            if (msgContainer.resolve(fileName) != null) {
              fileExists = true;
            }
          }

          if (fileExists) {
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

  }

  @SuppressWarnings("unchecked")
  private List<VFSItem> getTempFolderFileList() {
    if (tempUploadFolder == null) {
      tempUploadFolder = new OlatRootFolderImpl(File.separator + "tmp/" + CodeHelper.getGlobalForeverUniqueID() + "/", null);
    }   
    return tempUploadFolder.getItems(exclFilter);
  }
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.