diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/SessionWorkspaceUtil.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/SessionWorkspaceUtil.java index 67ac76df110b63d1bd47d8d37f60f23b23c99c5a..32c7d3b290d2b29578c76b5dfb5ad2125f8d74fc 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/SessionWorkspaceUtil.java +++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/SessionWorkspaceUtil.java @@ -19,6 +19,8 @@ package ch.systemsx.cisd.openbis.dss.generic.shared.utils; import java.io.File; import java.util.Properties; +import ch.systemsx.cisd.common.filesystem.QueueingPathRemoverService; + /** * Utility functions for session workspace. * @@ -32,8 +34,13 @@ public class SessionWorkspaceUtil public static File getSessionWorkspace(Properties properties) { - return new File(properties.getProperty(SESSION_WORKSPACE_ROOT_DIR_KEY, + File workspace = new File(properties.getProperty(SESSION_WORKSPACE_ROOT_DIR_KEY, SESSION_WORKSPACE_ROOT_DIR_DEFAULT)); + if (workspace.exists()) + { + QueueingPathRemoverService.removeRecursively(workspace); + } + return workspace; } }