Class TemporaryDirectory.TemporaryDirectoryResource

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource, Resource<java.nio.file.Path>
    Enclosing class:
    TemporaryDirectory

    private static final class TemporaryDirectory.TemporaryDirectoryResource
    extends java.lang.Object
    implements Resource<java.nio.file.Path>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.file.Path tempDir  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the resource.
      private static void deleteRecursively​(java.nio.file.Path tempDir)  
      java.nio.file.Path get()
      Returns the contents of the resource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tempDir

        private final java.nio.file.Path tempDir
    • Constructor Detail

      • TemporaryDirectoryResource

        TemporaryDirectoryResource​(java.nio.file.Path tempDir)
    • Method Detail

      • get

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

        public void close()
                   throws java.lang.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<java.nio.file.Path>
        Throws:
        java.lang.Exception - if closing the resource failed
      • deleteRecursively

        private static void deleteRecursively​(java.nio.file.Path tempDir)
                                       throws java.io.IOException
        Throws:
        java.io.IOException