diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java index d4aeee6..686ee98 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/server/generator/ProjectBuilder.java @@ -132,16 +132,19 @@ public class ProjectBuilder { } private void createMainCodeIfRequest() throws StatAlgoImporterServiceException { - if (project.getMainCode() != null && project.getMainCode().getItemDescription() != null) { - ItemDescription mainCodeItemDescription = project.getMainCode().getItemDescription(); - if (mainCodeItemDescription.getId() != null && !mainCodeItemDescription.getId().isEmpty()) { - FilesStorage filesStorage = new FilesStorage(); - filesStorage.deleteItemOnFolder(serviceCredentials.getUserName(), mainCodeItemDescription.getId()); + if (project.getProjectConfig() != null && project.getProjectConfig().getProjectSupport() != null + && project.getProjectConfig().getProjectSupport() instanceof ProjectSupportBlackBox) { + if (project.getMainCode() != null && project.getMainCode().getItemDescription() != null) { + ItemDescription mainCodeItemDescription = project.getMainCode().getItemDescription(); + if (mainCodeItemDescription.getId() != null && !mainCodeItemDescription.getId().isEmpty()) { + FilesStorage filesStorage = new FilesStorage(); + filesStorage.deleteItemOnFolder(serviceCredentials.getUserName(), mainCodeItemDescription.getId()); + } } + MainGenerator mainGenerator = new MainGenerator(); + mainGenerator.createMain(serviceCredentials, project); } - MainGenerator mainGenerator = new MainGenerator(); - mainGenerator.createMain(serviceCredentials, project); } private void repackageProjectPackage() throws StatAlgoImporterServiceException {