Add temp folder for downloading DMP exported files
This commit is contained in:
parent
2c16e1c376
commit
78753404b5
|
@ -358,7 +358,7 @@ public class DataManagementPlanManager {
|
||||||
fileName = dmpEntity.getLabel();
|
fileName = dmpEntity.getLabel();
|
||||||
}
|
}
|
||||||
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
||||||
File exportFile = new File(fileName + ".docx");
|
File exportFile = new File(this.environment.getProperty("temp.temp") + fileName + ".docx");
|
||||||
FileOutputStream out = new FileOutputStream(exportFile);
|
FileOutputStream out = new FileOutputStream(exportFile);
|
||||||
document.write(out);
|
document.write(out);
|
||||||
out.close();
|
out.close();
|
||||||
|
@ -1001,7 +1001,7 @@ public class DataManagementPlanManager {
|
||||||
List<Dataset> datasets = dmp.getDataset().stream().collect(Collectors.toList());
|
List<Dataset> datasets = dmp.getDataset().stream().collect(Collectors.toList());
|
||||||
String fileName = dmp.getLabel();
|
String fileName = dmp.getLabel();
|
||||||
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
||||||
File xmlFile = new File(fileName + ".xml");
|
File xmlFile = new File(this.environment.getProperty("temp.temp") + fileName + ".xml");
|
||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(xmlFile, true));
|
BufferedWriter writer = new BufferedWriter(new FileWriter(xmlFile, true));
|
||||||
Document xmlDoc = XmlBuilder.getDocument();
|
Document xmlDoc = XmlBuilder.getDocument();
|
||||||
Element dmpElement = xmlDoc.createElement("dmp");
|
Element dmpElement = xmlDoc.createElement("dmp");
|
||||||
|
@ -1138,7 +1138,7 @@ public class DataManagementPlanManager {
|
||||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
String fileName = dmp.getLabel();
|
String fileName = dmp.getLabel();
|
||||||
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
||||||
File file = new File(fileName + ".json");
|
File file = new File(this.environment.getProperty("temp.temp") + fileName + ".json");
|
||||||
OutputStream output = new FileOutputStream(file);
|
OutputStream output = new FileOutputStream(file);
|
||||||
try {
|
try {
|
||||||
// mapper.writeValue(file, rdaExportModel);
|
// mapper.writeValue(file, rdaExportModel);
|
||||||
|
|
|
@ -91,3 +91,6 @@ notification.modifiedFinalised.subject=[OpenDMP] The {name} has been modified an
|
||||||
|
|
||||||
#############LOGGING#########
|
#############LOGGING#########
|
||||||
logging.config=classpath:logging/logback-${spring.profiles.active}.xml
|
logging.config=classpath:logging/logback-${spring.profiles.active}.xml
|
||||||
|
|
||||||
|
#############TEMP#########
|
||||||
|
temp.temp=tmp/
|
Loading…
Reference in New Issue