solved big on home update
This commit is contained in:
parent
6756c2890c
commit
88406a3bf2
6
pom.xml
6
pom.xml
|
@ -398,12 +398,6 @@
|
||||||
<version>8.3.3</version>
|
<version>8.3.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.social-networking</groupId>
|
|
||||||
<artifactId>social-service-client</artifactId>
|
|
||||||
<version>[1.1.0, 2.0.0)</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>storagehub-client-library</artifactId>
|
<artifactId>storagehub-client-library</artifactId>
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class ClassHandler {
|
||||||
|
|
||||||
Set<Class<?>> classesAnnotated = reflection.getTypesAnnotatedWith(RootNode.class);
|
Set<Class<?>> classesAnnotated = reflection.getTypesAnnotatedWith(RootNode.class);
|
||||||
for (Class<?> clazz: classesAnnotated ){
|
for (Class<?> clazz: classesAnnotated ){
|
||||||
if (RootItem.class.isAssignableFrom(clazz)) {
|
if (RootItem.class.isAssignableFrom(clazz) && clazz.isAnnotationPresent(RootNode.class)) {
|
||||||
String value = clazz.getAnnotation(RootNode.class).value();
|
String value = clazz.getAnnotation(RootNode.class).value();
|
||||||
log.debug("loading class {} with value {} ", clazz, value );
|
log.debug("loading class {} with value {} ", clazz, value );
|
||||||
classMap.put(value, (Class<? extends RootItem>) clazz);
|
classMap.put(value, (Class<? extends RootItem>) clazz);
|
||||||
|
|
|
@ -269,7 +269,8 @@ public class UserManager {
|
||||||
Node homeNode = session.getNode("/Home");
|
Node homeNode = session.getNode("/Home");
|
||||||
Node userHome = homeNode.getNode(user);
|
Node userHome = homeNode.getNode(user);
|
||||||
|
|
||||||
|
if (userHome == null)
|
||||||
|
throw new BackendGenericError("home for user {} not found");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//creating workspace folder
|
//creating workspace folder
|
||||||
|
@ -282,7 +283,7 @@ public class UserManager {
|
||||||
org.gcube.common.storagehub.model.Path workspacePath = Paths.append(Paths.getPath(userHome.getPath()),Constants.WORKSPACE_ROOT_FOLDER_NAME);
|
org.gcube.common.storagehub.model.Path workspacePath = Paths.append(Paths.getPath(userHome.getPath()),Constants.WORKSPACE_ROOT_FOLDER_NAME);
|
||||||
Boolean oldTrashExists = session.nodeExists(Paths.append(workspacePath, Constants.TRASH_ROOT_FOLDER_NAME).toPath());
|
Boolean oldTrashExists = session.nodeExists(Paths.append(workspacePath, Constants.TRASH_ROOT_FOLDER_NAME).toPath());
|
||||||
if (oldTrashExists)
|
if (oldTrashExists)
|
||||||
session.move(Paths.append(workspacePath, Constants.TRASH_ROOT_FOLDER_NAME).toPath(), Paths.append(Paths.getPath(homeNode.getPath()), Constants.TRASH_ROOT_FOLDER_NAME).toPath());
|
session.move(Paths.append(workspacePath, Constants.TRASH_ROOT_FOLDER_NAME).toPath(), Paths.append(Paths.getPath(userHome.getPath()), Constants.TRASH_ROOT_FOLDER_NAME).toPath());
|
||||||
else {
|
else {
|
||||||
FolderCreationParameters trashFolderParameters = FolderCreationParameters.builder().name(Constants.TRASH_ROOT_FOLDER_NAME).description("trash of "+user).author(user).on(userHome.getIdentifier()).with(session).build();
|
FolderCreationParameters trashFolderParameters = FolderCreationParameters.builder().name(Constants.TRASH_ROOT_FOLDER_NAME).description("trash of "+user).author(user).on(userHome.getIdentifier()).with(session).build();
|
||||||
Utils.createFolderInternally(trashFolderParameters, null, true);
|
Utils.createFolderInternally(trashFolderParameters, null, true);
|
||||||
|
@ -291,7 +292,7 @@ public class UserManager {
|
||||||
Boolean oldVresExists = session.nodeExists(Paths.append(workspacePath, Constants.OLD_VRE_FOLDER_PARENT_NAME).toPath());
|
Boolean oldVresExists = session.nodeExists(Paths.append(workspacePath, Constants.OLD_VRE_FOLDER_PARENT_NAME).toPath());
|
||||||
|
|
||||||
if (oldVresExists)
|
if (oldVresExists)
|
||||||
session.move(Paths.append(workspacePath, Constants.OLD_VRE_FOLDER_PARENT_NAME).toPath(), Paths.append(Paths.getPath(homeNode.getPath()), Constants.PERSONAL_VRES_FOLDER_PARENT_NAME).toPath());
|
session.move(Paths.append(workspacePath, Constants.OLD_VRE_FOLDER_PARENT_NAME).toPath(), Paths.append(Paths.getPath(userHome.getPath()), Constants.PERSONAL_VRES_FOLDER_PARENT_NAME).toPath());
|
||||||
else {
|
else {
|
||||||
//creating Vre container folder
|
//creating Vre container folder
|
||||||
FolderCreationParameters vreFolderParameters = FolderCreationParameters.builder().name(Constants.PERSONAL_VRES_FOLDER_PARENT_NAME).description("vre folder container of "+user).author(user).on(userHome.getIdentifier()).with(session).build();
|
FolderCreationParameters vreFolderParameters = FolderCreationParameters.builder().name(Constants.PERSONAL_VRES_FOLDER_PARENT_NAME).description("vre folder container of "+user).author(user).on(userHome.getIdentifier()).with(session).build();
|
||||||
|
|
|
@ -25,7 +25,7 @@ The projects leading to this software have received funding from a series of
|
||||||
Version
|
Version
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
1.5.0-SNAPSHOT (20221003-152207)
|
1.5.0-SNAPSHOT (20221004-105146)
|
||||||
|
|
||||||
Please see the file named "changelog.xml" in this directory for the release notes.
|
Please see the file named "changelog.xml" in this directory for the release notes.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue