Class OutputDir
- java.lang.Object
-
- org.junit.platform.launcher.listeners.OutputDir
-
@API(status=INTERNAL, since="1.9") public class OutputDir extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternOUTPUT_DIR_UNIQUE_NUMBER_PLACEHOLDER_PATTERNprivate java.nio.file.Pathpathprivate java.security.SecureRandomrandom
-
Constructor Summary
Constructors Modifier Constructor Description privateOutputDir(java.nio.file.Path path, java.security.SecureRandom random)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleancontainsFilesWithExtensions(java.nio.file.Path dir, java.lang.String... extensions)Determine if the supplied directory contains files with any of the supplied extensions.static OutputDircreate(java.util.Optional<java.lang.String> customDir)(package private) static OutputDircreate(java.util.Optional<java.lang.String> customDir, java.util.function.Supplier<java.nio.file.Path> currentWorkingDir)java.nio.file.PathcreateFile(java.lang.String prefix, java.lang.String extension)(package private) static OutputDircreateSafely(java.util.Optional<java.lang.String> customDir, java.util.function.Supplier<java.nio.file.Path> currentWorkingDir)Package private for testing purposes.private static OutputDircreateSafely(java.util.Optional<java.lang.String> customDir, java.util.function.Supplier<java.nio.file.Path> currentWorkingDir, java.security.SecureRandom random)java.nio.file.PathtoPath()
-
-
-
Method Detail
-
create
public static OutputDir create(java.util.Optional<java.lang.String> customDir)
-
create
static OutputDir create(java.util.Optional<java.lang.String> customDir, java.util.function.Supplier<java.nio.file.Path> currentWorkingDir)
-
createSafely
static OutputDir createSafely(java.util.Optional<java.lang.String> customDir, java.util.function.Supplier<java.nio.file.Path> currentWorkingDir) throws java.io.IOException
Package private for testing purposes.- Throws:
java.io.IOException
-
createSafely
private static OutputDir createSafely(java.util.Optional<java.lang.String> customDir, java.util.function.Supplier<java.nio.file.Path> currentWorkingDir, java.security.SecureRandom random) throws java.io.IOException
- Throws:
java.io.IOException
-
toPath
public java.nio.file.Path toPath()
-
createFile
public java.nio.file.Path createFile(java.lang.String prefix, java.lang.String extension) throws java.io.UncheckedIOException- Throws:
java.io.UncheckedIOException
-
containsFilesWithExtensions
private static boolean containsFilesWithExtensions(java.nio.file.Path dir, java.lang.String... extensions) throws java.io.IOExceptionDetermine if the supplied directory contains files with any of the supplied extensions.- Throws:
java.io.IOException
-
-