forked from Qortal/qortal
Use system temp directory instead of making a "temp" subfolder when zipping files.
This commit is contained in:
parent
fe7c40cb7c
commit
47c70eea9e
@ -136,15 +136,16 @@ public class WebsiteResource {
|
||||
}
|
||||
|
||||
// Ensure temp folder exists
|
||||
java.nio.file.Path tempDir = null;
|
||||
try {
|
||||
Files.createDirectories(Paths.get("temp"));
|
||||
tempDir = Files.createTempDirectory("qortal-zip");
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Unable to create temp directory");
|
||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE);
|
||||
}
|
||||
|
||||
// Firstly zip up the directory
|
||||
String outputFilePath = "temp/zipped.zip";
|
||||
String outputFilePath = tempDir.toString() + File.separator + "zipped.zip";
|
||||
try {
|
||||
ZipUtils.zip(directoryPath, outputFilePath, "data");
|
||||
} catch (IOException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user