public class SelfDeletingTempDirectory extends java.lang.Object implements java.lang.AutoCloseable
AutoCloseable wrapper around
Files.createTempDirectory(String, java.nio.file.attribute.FileAttribute...)
that deletes the temp directory when closed.| Constructor and Description |
|---|
SelfDeletingTempDirectory(java.lang.String prefix)
Creates a new temp directory using the given prefix to determine its
name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Recursively deletes the temp directory.
|
java.io.File |
getDirectory() |
public SelfDeletingTempDirectory(java.lang.String prefix) throws java.io.IOException
java.io.IOExceptionpublic java.io.File getDirectory()
directorypublic void close()
close in interface java.lang.AutoCloseable