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 e8f6dbd..e7b2986 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 @@ -91,12 +91,10 @@ public class PublicationsRetrieverPlugin { File curAssignmentsDirs = new File(FileUtils.storeDocFilesDir); try { - if ( !curAssignmentsDirs.mkdirs() ) // Create the subdirectory. - logger.error("Could not create the \"assignments_" + assignmentRequestCounter + "_fullTexts\" directories: \"" + FileUtils.storeDocFilesDir + "\"!"); + 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 + "\"!"); } catch (Exception e) { // Mainly a SecurityException. - String errorMsg = "Failed to create the full-texts directory for assignments_" + assignmentRequestCounter; - logger.error(errorMsg, e); - throw new RuntimeException(errorMsg + ": " + e.getMessage()); + throw new RuntimeException("Failed to create the full-texts directory for assignments_" + assignmentRequestCounter + ": " + e.getMessage()); } // Start loading and checking urls.