Fixes Dataset export doc and pdf not deleting the in memory files.
This commit is contained in:
parent
e344f7ce6e
commit
6818eaf8bf
|
@ -150,8 +150,9 @@ public class DatasetWizardController extends BaseController {
|
||||||
responseHeaders.get("Access-Control-Expose-Headers").add("Content-Type");
|
responseHeaders.get("Access-Control-Expose-Headers").add("Content-Type");
|
||||||
|
|
||||||
byte[] content = IOUtils.toByteArray(resource);
|
byte[] content = IOUtils.toByteArray(resource);
|
||||||
//Files.deleteIfExists(pdffile.toPath());
|
resource.close();
|
||||||
//Files.deleteIfExists(file.toPath());
|
Files.deleteIfExists(file.toPath());
|
||||||
|
Files.deleteIfExists(pdffile.toPath());
|
||||||
return new ResponseEntity<>(content,
|
return new ResponseEntity<>(content,
|
||||||
responseHeaders,
|
responseHeaders,
|
||||||
HttpStatus.OK);
|
HttpStatus.OK);
|
||||||
|
|
|
@ -285,6 +285,7 @@ public class DatasetManager {
|
||||||
FileOutputStream output = new FileOutputStream(resultPdf);
|
FileOutputStream output = new FileOutputStream(resultPdf);
|
||||||
IOUtils.write(queueResult, output);
|
IOUtils.write(queueResult, output);
|
||||||
output.close();
|
output.close();
|
||||||
|
Files.deleteIfExists(file.toPath());
|
||||||
|
|
||||||
return resultPdf;
|
return resultPdf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue