diff --git a/src/main/java/eu/openaire/urls_worker/components/plugins/PublicationsRetrieverPlugin.java b/src/main/java/eu/openaire/urls_worker/components/plugins/PublicationsRetrieverPlugin.java index 305c7ad..b36fb3b 100644 --- a/src/main/java/eu/openaire/urls_worker/components/plugins/PublicationsRetrieverPlugin.java +++ b/src/main/java/eu/openaire/urls_worker/components/plugins/PublicationsRetrieverPlugin.java @@ -80,8 +80,11 @@ public class PublicationsRetrieverPlugin { File curAssignmentsDirs = new File(FileUtils.storeDocFilesDir); try { - if ( ! curAssignmentsDirs.mkdirs() ) // Create the subdirectory. It may return "false", in case it already exists (will not happen, unless there is problem in cleaning up of the subdirectories) or any problem occurred. - throw new RuntimeException("Could not create the \"assignments_" + assignmentRequestCounter + "_fullTexts\" directories: \"" + FileUtils.storeDocFilesDir + "\"!"); + if ( !curAssignmentsDirs.exists() ) { + if ( !curAssignmentsDirs.mkdirs() ) // Try to create the directory(-ies) if they don't exist. If they exist OR if sth went wrong, the result is the same: "false". + throw new RuntimeException("Could not create the \"" + currentAssignmentsSubDir + "\" directories: \"" + FileUtils.storeDocFilesDir + "\"!"); + } else + logger.warn("The curAssignmentsDirs: \"" + currentAssignmentsSubDir + "\" already exist! Probably left behind by a previous execution.."); } catch (Exception e) { // Mainly a SecurityException. throw new RuntimeException("Failed to create the full-texts directory for assignments_" + assignmentRequestCounter + ": " + e.getMessage()); } diff --git a/src/main/java/eu/openaire/urls_worker/controllers/GeneralController.java b/src/main/java/eu/openaire/urls_worker/controllers/GeneralController.java index dfdbb38..d2d1bfe 100644 --- a/src/main/java/eu/openaire/urls_worker/controllers/GeneralController.java +++ b/src/main/java/eu/openaire/urls_worker/controllers/GeneralController.java @@ -66,7 +66,7 @@ public class GeneralController { String finalMsg = ""; if ( shouldShutdownWorker ) - finalMsg = "The worker has already received a \"shutdownWorker\" (which was not canceled afterwards). "; + finalMsg = "The worker has already received a \"shutdownWorker\" request (which was not canceled afterwards). "; else shouldShutdownWorker = true;