Class TempDirFactory.Standard

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, TempDirFactory
    Enclosing interface:
    TempDirFactory

    public static class TempDirFactory.Standard
    extends java.lang.Object
    implements TempDirFactory
    Standard TempDirFactory implementation which delegates to Files.createTempDirectory(java.nio.file.Path, java.lang.String, java.nio.file.attribute.FileAttribute<?>...) using "junit" as the prefix.
    See Also:
    Files.createTempDirectory(java.lang.String, java.nio.file.attribute.FileAttribute[])
    • Constructor Detail

      • Standard

        public Standard()
    • Method Detail

      • createTempDirectory

        public java.nio.file.Path createTempDirectory​(AnnotatedElementContext elementContext,
                                                      ExtensionContext extensionContext)
                                               throws java.io.IOException
        Description copied from interface: TempDirFactory
        Create a new temporary directory.

        Depending on the implementation, the resulting Path may or may not be associated with the default FileSystem.

        Specified by:
        createTempDirectory in interface TempDirFactory
        Parameters:
        elementContext - the context of the field or parameter where @TempDir is declared; never null
        extensionContext - the current extension context; never null
        Returns:
        the path to the newly created temporary directory; never null
        Throws:
        java.io.IOException