Package org.olat.core.util.vfs

Examples of org.olat.core.util.vfs.Quota


    previewVC.put("folder", folder.getInitialComponent());
    // get additional infos
    VFSSecurityCallback secCallback = new FolderNodeCallback(namedContainer.getRelPath(), ne, false, false, null);
    previewVC.contextPut("canUpload", Boolean.valueOf(secCallback.canWrite()));
    previewVC.contextPut("canDownload", Boolean.valueOf(secCallback.canRead()));
    Quota q = secCallback.getQuota();
    previewVC.contextPut("quotaKB", (q != null) ? q.getQuotaKB().toString() : "-");
    setInitialComponent(previewVC);
  }
View Full Code Here


    this.userCourseEnv = userCourseEnv;
    this.courseNode = courseNode;
    QuotaManager qm = QuotaManager.getInstance();
    quota = qm.getCustomQuota(relPath);
    if (quota == null) { // if no custom quota set, use the default quotas...
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER);
      quota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

   *      org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == vfButton){
      OlatNamedContainerImpl namedContainer = BCCourseNode.getNodeFolderContainer(bcNode, course.getCourseEnvironment());
      Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
      if (quota == null) {
        Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
        quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
      }
      VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
      namedContainer.setLocalSecurityCallback(secCallback);
      CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
          new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
View Full Code Here

      }
    } else if (source == vfButton) {     
      if (log.isDebug()) log.debug("Event for sampleVC");
      // switch to new dialog
      OlatNamedContainerImpl namedContainer = TACourseNode.getNodeFolderContainer(node, course.getCourseEnvironment());
      Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
      if (quota == null) {
        Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
        quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
      }
      VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
      namedContainer.setLocalSecurityCallback(secCallback);
      CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
        new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
View Full Code Here

  private void initTaskFolderQuota(String relPath) {
    QuotaManager qm = QuotaManager.getInstance();
    folderQuota = qm.getCustomQuota(relPath);
    if (folderQuota == null) {
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER);
      folderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

    this.isGuestOnly = isGuestOnly;
    this.nodefolderSubContext = nodefolderSubContext;
    QuotaManager qm = QuotaManager.getInstance();
    nodeFolderQuota = qm.getCustomQuota(relPath);
    if (nodeFolderQuota == null) {
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
      nodeFolderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

   */
  private void initSharedFolderQuota(String relPath) {
    QuotaManager qm = QuotaManager.getInstance();
    sharedFolderQuota = qm.getCustomQuota(relPath);
    if (sharedFolderQuota == null) {
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE);
      sharedFolderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

       
        // create container and set quota
        OlatRootFolderImpl localImpl = new OlatRootFolderImpl(tools.getFolderRelPath(), cfRoot);
        localImpl.getBasefile().mkdirs(); // lazy initialize dirs
        NamedContainerImpl grpContainer = new NamedContainerImpl(Formatter.makeStringFilesystemSave(name), localImpl);
        Quota q = qm.getCustomQuota(tools.getFolderRelPath());
        if (q == null) {
          Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS);
          q = QuotaManager.getInstance().createQuota(tools.getFolderRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
        }
        FullAccessWithQuotaCallback secCallback = new FullAccessWithQuotaCallback(q);
        grpContainer.setLocalSecurityCallback(secCallback);
       
        // add container
View Full Code Here

   * @param ureq
   * @return max upload limit in KB
   */
  private int getUploadLimit(UserRequest ureq) {
    String dropboxPath = getRelativeDropBoxFilePath(ureq.getIdentity());
    Quota dropboxQuota = QuotaManager.getInstance().getCustomQuota(dropboxPath);
    if (dropboxQuota == null) {
      dropboxQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
    }
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl( getRelativeDropBoxFilePath(ureq.getIdentity()), null);
    VFSContainer dropboxContainer = new OlatNamedContainerImpl(ureq.getIdentity().getName(), rootFolder);
    FullAccessWithQuotaCallback secCallback = new FullAccessWithQuotaCallback(dropboxQuota);
    rootFolder.setLocalSecurityCallback(secCallback);
    int ulLimit = QuotaManager.getInstance().getUploadLimitKB(dropboxQuota.getQuotaKB(),dropboxQuota.getUlLimitKB(),dropboxContainer);
    return ulLimit;
  }
View Full Code Here

  private void initFolderQuota(String relPath) {
    QuotaManager qm = QuotaManager.getInstance();
    folderQuota = qm.getCustomQuota(relPath);
    if (folderQuota == null) {
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER);
      folderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.core.util.vfs.Quota

Copyright © 2018 www.massapicom. 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.