use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project OpenOLAT by OpenOLAT.
the class EPArtefactManager method getArtefactsTempContainer.
protected VFSContainer getArtefactsTempContainer(Identity ident) {
VFSContainer artRoot = new OlatRootFolderImpl(File.separator + "tmp", null);
VFSItem tmpI = artRoot.resolve("portfolio");
if (tmpI == null) {
tmpI = artRoot.createChildContainer("portfolio");
}
VFSItem userTmp = tmpI.resolve(ident.getName());
if (userTmp == null) {
userTmp = ((VFSContainer) tmpI).createChildContainer(ident.getName());
}
String idFolder = UUID.randomUUID().toString();
VFSContainer thisTmp = ((VFSContainer) userTmp).createChildContainer(idFolder);
return thisTmp;
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project OpenOLAT by OpenOLAT.
the class UserInfoMainController method doOpenFolder.
private FolderRunController doOpenFolder(UserRequest ureq) {
removeAsListenerAndDispose(folderRunController);
String chosenUserFolderRelPath = FolderConfig.getUserHome(chosenIdentity.getName()) + "/public";
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(chosenUserFolderRelPath, null);
OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(firstLastName, rootFolder);
// decided in plenum to have read only view in the personal visiting card, even for admin
VFSSecurityCallback secCallback = new ReadOnlyCallback();
namedFolder.setLocalSecurityCallback(secCallback);
OLATResourceable ores = OresHelper.createOLATResourceableType("userfolder");
WindowControl bwControl = addToHistory(ureq, ores, null);
folderRunController = new FolderRunController(namedFolder, false, true, false, ureq, bwControl);
folderRunController.setResourceURL("[Identity:" + chosenIdentity.getKey() + "][userfolder:0]");
listenTo(folderRunController);
return folderRunController;
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project OpenOLAT by OpenOLAT.
the class PersonalFolderManager method deleteUserData.
/**
* Delete personal-folder homes/<username> (private & public) of an user.
*/
@Override
public void deleteUserData(Identity identity, String newDeletedUserName, File archivePath) {
new OlatRootFolderImpl(getRootPathFor(identity), null).deleteSilently();
log.debug("Personal-folder deleted for identity=" + identity);
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project OpenOLAT by OpenOLAT.
the class BCCourseNode method getNodeFolderContainer.
/**
* Get a named container of a node with the node title as its name.
* @param node
* @param courseEnv
* @return
*/
public static OlatNamedContainerImpl getNodeFolderContainer(BCCourseNode node, CourseEnvironment courseEnv) {
String path = getFoldernodePathRelToFolderBase(courseEnv, node);
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(path, null);
OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(node.getShortTitle(), rootFolder);
return namedFolder;
}
use of org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl in project OpenOLAT by OpenOLAT.
the class CourseHandler method getMediaContainer.
@Override
public VFSContainer getMediaContainer(RepositoryEntry repoEntry) {
OLATResource resource = repoEntry.getOlatResource();
String relPath = File.separator + PersistingCourseImpl.COURSE_ROOT_DIR_NAME + File.separator + resource.getResourceableId();
VFSContainer rootFolder = new OlatRootFolderImpl(relPath, null);
VFSItem item = rootFolder.resolve("media");
VFSContainer mediaContainer;
if (item == null) {
mediaContainer = rootFolder.createChildContainer("media");
} else if (item instanceof VFSContainer) {
mediaContainer = (VFSContainer) item;
} else {
log.error("media folder is not a container", null);
mediaContainer = null;
}
return mediaContainer;
}
Aggregations