From 2033af45729767ffe1479ea5d84723b2fa68a9cc Mon Sep 17 00:00:00 2001 From: lucio Date: Thu, 30 Jan 2020 16:13:23 +0100 Subject: [PATCH] bug on vre folder displayName on folder containing - in the name solved --- .../gcube/data/access/storagehub/services/GroupManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/data/access/storagehub/services/GroupManager.java b/src/main/java/org/gcube/data/access/storagehub/services/GroupManager.java index 439c490..75cdb9e 100644 --- a/src/main/java/org/gcube/data/access/storagehub/services/GroupManager.java +++ b/src/main/java/org/gcube/data/access/storagehub/services/GroupManager.java @@ -510,15 +510,15 @@ public class GroupManager { String name = groupId; - String title = groupId.substring(groupId.lastIndexOf("-")+1); + String displayName = groupId.replaceAll("[^\\-]*\\-[^\\-]*\\-(.*)", "$1"); - log.info("creating vreFolder with name {} and title {} and owner {}", name, title, owner); + log.info("creating vreFolder with name {} and title {} and owner {}", name, displayName, owner); Node folder= Utils.createFolderInternally(session, sharedRootNode, name, "VREFolder for "+groupId, false, owner, null); folder.setPrimaryType(PrimaryNodeType.NT_WORKSPACE_SHARED_FOLDER); folder.setProperty(NodeProperty.IS_VRE_FOLDER.toString(), true); folder.setProperty(NodeProperty.TITLE.toString(), name); - folder.setProperty(NodeProperty.DISPLAY_NAME.toString(), title); + folder.setProperty(NodeProperty.DISPLAY_NAME.toString(), displayName); session.save(); AccessControlManager acm = session.getAccessControlManager();