Package org.olat.core.commons.modules.bc.vfs

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


   *
   * @param tmpMessage
   */
  public void persistTempUploadedFiles(Message tmpMessage) {
    if (tmpMessage == null) throw new AssertException("Message may not be null to persist temp files");
    OlatRootFolderImpl msgContainer = fm.getMessageContainer(message.getForum().getKey(), message.getKey());
    if (msgContainer != null) {
      List<VFSItem> tmpFList = getTempFolderFileList();
      for (VFSItem file : tmpFList) {
        VFSLeaf leaf = (VFSLeaf) file;
        FileUtils.copy(leaf.getInputStream(), msgContainer.createChildLeaf(leaf.getName()).getOutputStream(false));
      }
    }
    removeTempUploadedFiles();
  }
View Full Code Here


   * @param indexWriter
   * @throws IOException
   * @throws InterruptedException
   */
  private void doIndexFile(String filename, Long forumKey, SearchResourceContext leafResourceContext, OlatFullIndexer indexWriter) throws IOException,InterruptedException {
    OlatRootFolderImpl forumContainer = DialogElementsController.getForumContainer(forumKey);
    VFSLeaf leaf = (VFSLeaf) forumContainer.getItems(new VFSLeafFilter()).get(0);
    if (log.isDebug()) log.debug("Analyse VFSLeaf=" + leaf.getName());
    try {
      if (FileDocumentFactory.getInstance().isFileSupported(leaf)) {
        leafResourceContext.setFilePath(filename);
        leafResourceContext.setDocumentType(TYPE_FILE);
View Full Code Here

  /**
   * Delete personal-folder homes/<username> (private & public) of an user.
   */
  public void deleteUserData(Identity identity, String newDeletedUserName) {
    new OlatRootFolderImpl(getRootPathFor(identity), null).delete();
    Tracing.logDebug("Personal-folder deleted for identity=" + identity, this.getClass());
  }
View Full Code Here

  /**
   * @param res
   * @return olat root folder implementation of file resource
   */
  public OlatRootFolderImpl getFileResourceRootImpl(OLATResourceable res) {
    return new OlatRootFolderImpl(FolderConfig.getRepositoryHome() + "/" + res.getResourceableId(), null);
  }
View Full Code Here

      final SubscriptionContext subsContext) {
    // do not use a global translator since in the fututre a collaborationtools
    // may be shared among users
    PackageTranslator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    String relPath = getFolderRelPath();
    OlatRootFolderImpl rootContainer = new OlatRootFolderImpl(relPath, null);
    OlatNamedContainerImpl namedContainer = new OlatNamedContainerImpl(trans.translate("folder"), rootContainer);
    namedContainer.setLocalSecurityCallback(new CollabSecCallback(relPath, subsContext));
    FolderRunController frc = new FolderRunController(namedContainer, true, true, ureq, wControl);
    return frc;
  }
View Full Code Here

      fom.deleteForum(forumKey);
    }
    /*
     * delete the folder, if existing
     */
    OlatRootFolderImpl vfsContainer = new OlatRootFolderImpl(getFolderRelPath(), null);
    File fFolderRoot = vfsContainer.getBasefile();
    if (fFolderRoot.exists()) {
      FileUtils.deleteDirsAndFiles(fFolderRoot, true, true);
    }
   
    /*
 
View Full Code Here

      log.warn("Can not archive wiki repoEntry=" + ores.getResourceableId());
    }   
  }

  private void archiveFolder(OLATResourceable ores, String archiveFilePath) {
    OlatRootFolderImpl folderContainer = new OlatRootFolderImpl(getFolderRelPath(), null);
    File fFolderRoot = folderContainer.getBasefile();
    if (fFolderRoot.exists()) {
      String zipFileName = "del_folder_" + ores.getResourceableId() + ".zip";
      String fullZipFilePath = archiveFilePath + File.separator + zipFileName;
      ZipUtil.zipAll(fFolderRoot, new File(fullZipFilePath));
    }
View Full Code Here

  public OlatNamedContainerImpl getNamedSharedFolder(RepositoryEntry re) {
    return new OlatNamedContainerImpl(Formatter.makeStringFilesystemSave(re.getDisplayname()), getSharedFolder(re.getOlatResource()));
  }

  public OlatRootFolderImpl getSharedFolder(OLATResourceable res) {
    OlatRootFolderImpl rootFolderImpl = (OlatRootFolderImpl)FileResourceManager.getInstance().getFileResourceRootImpl(res).resolve(SharedFolderManager.FOLDER_NAME);
    if (rootFolderImpl == null) return null;
    rootFolderImpl.setLocalSecurityCallback(new SharedFolderSecurityCallback(rootFolderImpl.getRelPath()));
    return rootFolderImpl;
  }
View Full Code Here

        showOverviewTable(ureq, forumCallback);
      } else if (event.getCommand().equals(FolderEvent.UPLOAD_EVENT)) {
        String filename = null;
        try {
          // get size of file
          OlatRootFolderImpl forumContainer = getForumContainer(recentDialogElement.getForumKey());
          VFSLeaf vl = (VFSLeaf) forumContainer.getItems().get(0);
          String fileSize = StringHelper.formatMemory(vl.getSize());

          // new dialog element
          filename = ((FolderEvent) event).getFilename();
          DialogElement element = new DialogElement();
View Full Code Here

   *
   * @param ureq
   * @param command
   */
  private void doFileDelivery(UserRequest ureq, Long forumKey) {
    OlatRootFolderImpl forumContainer = getForumContainer(forumKey);
    VFSLeaf vl = (VFSLeaf) forumContainer.getItems(new VFSLeafFilter()).get(0);
   
    //ureq.getDispatchResult().setResultingMediaResource(new FileDialogMediaResource(vl));
    ureq.getDispatchResult().setResultingMediaResource(new VFSMediaResource(vl));
  }
View Full Code Here

TOP

Related Classes of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl

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.