From f930f4d97b8049379e92678d26b61a26def669b6 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 10 Dec 2018 10:41:01 +0000 Subject: [PATCH] ref 12977: SAI - Force the path of the project folder to be updated to a new format https://support.d4science.org/issues/12977 Now, when the project is open the path is forced to be updated git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@174704 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/file/CodeReader.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/file/CodeReader.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/file/CodeReader.java index 21598a1..d7014c0 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/file/CodeReader.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/file/CodeReader.java @@ -14,6 +14,7 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.St import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.MainCode; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectSupportBashEdit; +import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectSupportBlackBox; //import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectSupportBlackBox; import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectSupportREdit; import org.slf4j.Logger; @@ -84,23 +85,12 @@ public class CodeReader { readCodeFromItem(itemId); } } else { - /** - * TODO - * - * Check how if open a project after another already open if we write this code we create a lock - * this create a lock on workspace when we save the project. - * The Workspace does not have a fix for this issue, - * so I add this exception how workaround. - * - * - * if (project.getProjectConfig().getProjectSupport() - * instanceof ProjectSupportBlackBox) { - * - * logger.debug("Project Support BlackBox"); code = new - * ArrayList<>(); } else { - */ - throw new StatAlgoImporterServiceException("Error reading code!"); - // } + if (project.getProjectConfig().getProjectSupport() instanceof ProjectSupportBlackBox) { + logger.debug("Project Support BlackBox"); + code = new ArrayList<>(); + } else { + throw new StatAlgoImporterServiceException("Error reading code, invalid project support!"); + } } } } else {