Class TempDirectory.CloseablePath
java.lang.Object
org.junit.jupiter.engine.extension.TempDirectory.CloseablePath
- All Implemented Interfaces:
AutoCloseable, 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, AutoCloseable
- Since:
- 5.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AnnotatedElementprivate final org.junit.jupiter.api.io.CleanupModeprivate final Pathprivate final org.junit.jupiter.api.extension.ExtensionContextprivate final org.junit.jupiter.api.io.TempDirFactoryprivate static final org.junit.platform.commons.logging.Logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCloseablePath(org.junit.jupiter.api.io.TempDirFactory factory, org.junit.jupiter.api.io.CleanupMode cleanupMode, Class<?> elementType, org.junit.jupiter.api.extension.AnnotatedElementContext elementContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()private IOExceptionprivate SortedMap<Path, IOException> deleteAllFilesAndDirectories(TempDirectory.FileOperations fileOperations) private static StringdescriptionFor(AnnotatedElement annotatedElement) private static StringdescriptionFor(Executable executable) (package private) Pathget()private PathrelativizeSafely(Path path) private PathtryToDeleteOnExit(Path path) private static voidtryToResetPermissions(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 -
annotatedElement
-
extensionContext
private final org.junit.jupiter.api.extension.ExtensionContext extensionContext
-
-
Constructor Details
-
CloseablePath
private CloseablePath(org.junit.jupiter.api.io.TempDirFactory factory, org.junit.jupiter.api.io.CleanupMode cleanupMode, Class<?> elementType, 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource- Throws:
IOException
-
descriptionFor
- Since:
- 5.12
-
descriptionFor
- Since:
- 5.12
-
deleteAllFilesAndDirectories
private SortedMap<Path, IOException> deleteAllFilesAndDirectories(TempDirectory.FileOperations fileOperations) throws IOException - Throws:
IOException
-
tryToResetPermissions
-
createIOExceptionWithAttachedFailures
-
tryToDeleteOnExit
-
relativizeSafely
-