Class TemporaryDirectory.TemporaryDirectoryResource

java.lang.Object
org.junitpioneer.jupiter.resource.TemporaryDirectory.TemporaryDirectoryResource
All Implemented Interfaces:
org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource, Resource<Path>
Enclosing class:
TemporaryDirectory

private static final class TemporaryDirectory.TemporaryDirectoryResource extends Object implements Resource<Path>
Since:
1.9.0
  • Field Details

    • tempDir

      private final Path tempDir
  • Constructor Details

    • TemporaryDirectoryResource

      TemporaryDirectoryResource(Path tempDir)
  • Method Details

    • get

      public Path get()
      Description copied from interface: Resource
      Returns the contents of the resource.
      Specified by:
      get in interface Resource<Path>
    • close

      public void close() throws Exception
      Description copied from interface: Resource
      Closes the resource.
      Specified by:
      close in interface org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
      Specified by:
      close in interface Resource<Path>
      Throws:
      Exception - if closing the resource failed
    • deleteRecursively

      private static void deleteRecursively(Path tempDir) throws IOException
      Throws:
      IOException