September 2019
Intermediate to advanced
816 pages
18h 47m
English
Creating a temporary folder can be accomplished using Path createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs). This is a static method in the Files class that can be used as follows:
// C:\Users\Anghel\AppData\Local\Temp\8083202661590940905Path tmpNoPrefix = Files.createTempDirectory(null);
// C:\Users\Anghel\AppData\Local\Temp\logs_5825861687219258744String customDirPrefix = "logs_";Path tmpCustomPrefix = Files.createTempDirectory(customDirPrefix);