Skip to content

Commit

Permalink
security: use java.nio.files in Generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Feb 25, 2021
1 parent a4b766b commit 3b40539
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.slf4j.LoggerFactory;

import java.io.File;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -173,9 +174,7 @@ public static InputOption serverOptions(@SuppressWarnings("unused") String langu

protected static File getTmpFolder() {
try {
File outputFolder = File.createTempFile("codegen-", "-tmp");
outputFolder.delete();
outputFolder.mkdir();
File outputFolder = Files.createTempDirectory("codegen-").toFile();
outputFolder.deleteOnExit();
return outputFolder;
} catch (Exception e) {
Expand Down

0 comments on commit 3b40539

Please sign in to comment.