Esempio n. 1
0
 /**
  * Returns a mountable root containing all entries which will be exposed to the webdav mount.
  *
  * @return
  */
 private VFSContainer getMountableRoot(IdentityEnvironment identityEnv) {
   MergeSource vfsRoot = new MergeSource(null, "webdav");
   for (Map.Entry<String, WebDAVProvider> entry : webdavModule.getWebDAVProviders().entrySet()) {
     WebDAVProvider provider = entry.getValue();
     if (provider.hasAccess(identityEnv)) {
       vfsRoot.addContainer(new WebDAVProviderNamedContainer(identityEnv, provider));
     }
   }
   return vfsRoot;
 }
  @Override
  protected void init() {
    super.init();
    // mount /public
    String rootPath = PersonalFolderManager.getInstance().getRootPathFor(identity);
    OlatRootFolderImpl vfsPublic = new OlatRootFolderImpl(rootPath + "/public", this);
    // 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);
    addContainer(vfsNamedPublic);

    // mount /private
    OlatRootFolderImpl vfsPrivate = new OlatRootFolderImpl(rootPath + "/private", this);
    // 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);
    addContainer(vfsNamedPrivate);

    init = true;
  }