public final class TempDir
extends java.lang.Object
com.google.common.io.Files#createTempDir()
.Modifier and Type | Method and Description |
---|---|
static java.io.File |
forClass(java.lang.Class<?> testSuite,
java.nio.file.attribute.FileAttribute<?>... attrs)
Creates a temporary directory for the passed test suite class.
|
static java.io.File |
withPrefix(java.lang.String prefix,
java.nio.file.attribute.FileAttribute<?>... attrs)
Creates a temporary directory.
|
public static java.io.File withPrefix(java.lang.String prefix, java.nio.file.attribute.FileAttribute<?>... attrs)
The parent directory for the created is obtained from the system property
java.io.tmpdir
.
The prefix is used by the underlying JDK implementation and is NOT guaranteed in the name of the created directory name.
prefix
- this value would be used for generating the name of the created directory,
cannot be empty, or blankattrs
- an optional list of file attributes to set atomically when
creating the directoryjava.lang.IllegalStateException
- if the directory could not be createdFiles.createTempDirectory(Path, String, FileAttribute...)
public static java.io.File forClass(java.lang.Class<?> testSuite, java.nio.file.attribute.FileAttribute<?>... attrs)
The parent directory for the created is obtained from the system property
java.io.tmpdir
.
Implementation may use a simple name of the passed class as the prefix for the name of the generated directory, but this is NOT guaranteed.
testSuite
- the test suite class which needs the temporary directoryattrs
- an optional list of file attributes to set atomically when
creating the directoryjava.lang.IllegalStateException
- if the directory could not be createdwithPrefix(String, FileAttribute...)
,
Files.createTempDirectory(Path, String, FileAttribute...)