From 3ad3e739e2947186dc6700a9e24a7f382df8a39f Mon Sep 17 00:00:00 2001 From: Ainur Date: Tue, 1 Oct 2024 14:19:37 +0200 Subject: [PATCH] CB-5737 global project path fix --- .../src/io/cloudbeaver/server/WebGlobalProject.java | 10 +++++----- .../src/io/cloudbeaver/server/WebGlobalWorkspace.java | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalProject.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalProject.java index 660f4e9548..6cf1faec56 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalProject.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalProject.java @@ -34,15 +34,15 @@ public class WebGlobalProject extends BaseProjectImpl { private static final Log log = Log.getLog(WebGlobalProject.class); - private final String projectId; + private final String projectName; public WebGlobalProject( @NotNull DBPWorkspace workspace, @Nullable SMSessionContext sessionContext, - @NotNull String projectId + @NotNull String projectName ) { super(workspace, sessionContext); - this.projectId = projectId; + this.projectName = projectName; } @Override @@ -53,13 +53,13 @@ public boolean isVirtual() { @NotNull @Override public String getName() { - return projectId; + return projectName; } @NotNull @Override public Path getAbsolutePath() { - return getWorkspace().getAbsolutePath().resolve(projectId); + return getWorkspace().getAbsolutePath().resolve(projectName); } @Override diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalWorkspace.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalWorkspace.java index eccd9f1253..997c0dcded 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalWorkspace.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/server/WebGlobalWorkspace.java @@ -27,6 +27,7 @@ import org.jkiss.dbeaver.model.app.DBPProject; import org.jkiss.dbeaver.model.impl.app.BaseProjectImpl; import org.jkiss.dbeaver.model.impl.app.BaseWorkspaceImpl; +import org.jkiss.utils.CommonUtils; import java.io.IOException; import java.net.URI; @@ -82,7 +83,8 @@ public void initializeProjects() { globalProject = new WebGlobalProject( this, getAuthContext(), - WebAppUtils.getGlobalProjectId()); + CommonUtils.notEmpty(WebAppUtils.getWebApplication().getDefaultProjectName()) + ); activeProject = globalProject; }