When uploading dataset template xmls delete the working directory copy of the file

This commit is contained in:
George Kalampokis 2020-09-11 16:31:57 +03:00
parent 418d29b7d5
commit 2390a33a98
1 changed files with 4 additions and 1 deletions

View File

@ -199,7 +199,10 @@ public class DatasetProfileManager {
public eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.DatasetProfile createDatasetProfileFromXml(MultipartFile multiPartFile) {
ImportXmlBuilderDatasetProfile xmlBuilder = new ImportXmlBuilderDatasetProfile();
try {
return xmlBuilder.build(convert(multiPartFile));
File localFile = convert(multiPartFile);
eu.eudat.logic.utilities.documents.xml.datasetProfileXml.datasetProfileModel.DatasetProfile profile = xmlBuilder.build(localFile);
Files.deleteIfExists(localFile.toPath());
return profile;
} catch (IOException e) {
logger.error(e.getMessage(), e);
}