delete files used for deposit in tmp storage

This commit is contained in:
Bernaldo Mihasi 2022-12-27 09:44:43 +02:00
parent 749dbefc38
commit 66b2596036
1 changed files with 8 additions and 1 deletions

View File

@ -2126,7 +2126,10 @@ public class DataManagementPlanManager {
}
}
}
Files.deleteIfExists(supportingFilesZip.toPath());
if(supportingFilesZip != null) {
Files.deleteIfExists(supportingFilesZip.toPath());
}
Files.deleteIfExists(pdfFile.toPath());
Files.deleteIfExists(file.getFile().toPath());
return finalDoi;
@ -2189,6 +2192,7 @@ public class DataManagementPlanManager {
if(supportingFilesZip != null) {
Files.deleteIfExists(supportingFilesZip.toPath());
}
Files.deleteIfExists(pdfFile.toPath());
Files.deleteIfExists(file.getFile().toPath());
return doiModel;
@ -2216,6 +2220,9 @@ public class DataManagementPlanManager {
}
}
zout.close();
if(!hasFileUploaded){
Files.deleteIfExists(new File(this.environment.getProperty("temp.temp") + "supportingFiles.zip").toPath());
}
return hasFileUploaded ? new File(this.environment.getProperty("temp.temp") + "supportingFiles.zip") : null;
}