Class TempDirectory.CloseablePath
java.lang.Object
org.junit.jupiter.engine.extension.TempDirectory.CloseablePath
- All Implemented Interfaces:
org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
- Enclosing class:
TempDirectory
static class TempDirectory.CloseablePath
extends Object
implements org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.junit.jupiter.api.io.CleanupMode
private final Path
private final org.junit.jupiter.api.extension.ExtensionContext
private final org.junit.jupiter.api.io.TempDirFactory
private static final org.junit.platform.commons.logging.Logger
-
Constructor Summary
ConstructorsConstructorDescriptionCloseablePath
(org.junit.jupiter.api.io.TempDirFactory factory, org.junit.jupiter.api.io.CleanupMode cleanupMode, org.junit.jupiter.api.extension.AnnotatedElementContext elementContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private IOException
private SortedMap
<Path, IOException> deleteAllFilesAndDirectories
(TempDirectory.FileOperations fileOperations) (package private) Path
get()
private Path
relativizeSafely
(Path path) private Path
tryToDeleteOnExit
(Path path) private static void
tryToResetPermissions
(Path path)
-
Field Details
-
logger
private static final org.junit.platform.commons.logging.Logger logger -
dir
-
factory
private final org.junit.jupiter.api.io.TempDirFactory factory -
cleanupMode
private final org.junit.jupiter.api.io.CleanupMode cleanupMode -
extensionContext
private final org.junit.jupiter.api.extension.ExtensionContext extensionContext
-
-
Constructor Details
-
CloseablePath
CloseablePath(org.junit.jupiter.api.io.TempDirFactory factory, org.junit.jupiter.api.io.CleanupMode cleanupMode, org.junit.jupiter.api.extension.AnnotatedElementContext elementContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception - Throws:
Exception
-
-
Method Details
-
get
Path get() -
close
- Specified by:
close
in interfaceorg.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
- Throws:
IOException
-
deleteAllFilesAndDirectories
private SortedMap<Path,IOException> deleteAllFilesAndDirectories(TempDirectory.FileOperations fileOperations) throws IOException - Throws:
IOException
-
tryToResetPermissions
-
createIOExceptionWithAttachedFailures
-
tryToDeleteOnExit
-
relativizeSafely
-