Class TempDirectory.CloseablePath
- java.lang.Object
-
- org.junit.jupiter.engine.extension.TempDirectory.CloseablePath
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource
- Enclosing class:
- TempDirectory
static class TempDirectory.CloseablePath extends java.lang.Object implements org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource, java.lang.AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.AnnotatedElementannotatedElementprivate org.junit.jupiter.api.io.CleanupModecleanupModeprivate java.nio.file.Pathdirprivate org.junit.jupiter.api.extension.ExtensionContextextensionContextprivate org.junit.jupiter.api.io.TempDirFactoryfactoryprivate static org.junit.platform.commons.logging.LoggerLOGGER
-
Constructor Summary
Constructors Modifier Constructor Description privateCloseablePath(org.junit.jupiter.api.io.TempDirFactory factory, org.junit.jupiter.api.io.CleanupMode cleanupMode, java.lang.Class<?> elementType, org.junit.jupiter.api.extension.AnnotatedElementContext elementContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private java.io.IOExceptioncreateIOExceptionWithAttachedFailures(java.util.SortedMap<java.nio.file.Path,java.io.IOException> failures)private java.util.SortedMap<java.nio.file.Path,java.io.IOException>deleteAllFilesAndDirectories(TempDirectory.FileOperations fileOperations)private static java.lang.StringdescriptionFor(java.lang.reflect.AnnotatedElement annotatedElement)private static java.lang.StringdescriptionFor(java.lang.reflect.Executable executable)(package private) java.nio.file.Pathget()private java.nio.file.PathrelativizeSafely(java.nio.file.Path path)private java.nio.file.PathtryToDeleteOnExit(java.nio.file.Path path)private static voidtryToResetPermissions(java.nio.file.Path path)
-
-
-
Field Detail
-
LOGGER
private static final org.junit.platform.commons.logging.Logger LOGGER
-
dir
private final java.nio.file.Path dir
-
factory
private final org.junit.jupiter.api.io.TempDirFactory factory
-
cleanupMode
private final org.junit.jupiter.api.io.CleanupMode cleanupMode
-
annotatedElement
private final java.lang.reflect.AnnotatedElement annotatedElement
-
extensionContext
private final org.junit.jupiter.api.extension.ExtensionContext extensionContext
-
-
Constructor Detail
-
CloseablePath
private CloseablePath(org.junit.jupiter.api.io.TempDirFactory factory, org.junit.jupiter.api.io.CleanupMode cleanupMode, java.lang.Class<?> elementType, org.junit.jupiter.api.extension.AnnotatedElementContext elementContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws java.lang.Exception- Throws:
java.lang.Exception
-
-
Method Detail
-
get
java.nio.file.Path get()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceorg.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource- Throws:
java.io.IOException
-
descriptionFor
private static java.lang.String descriptionFor(java.lang.reflect.AnnotatedElement annotatedElement)
- Since:
- 5.12
-
descriptionFor
private static java.lang.String descriptionFor(java.lang.reflect.Executable executable)
- Since:
- 5.12
-
deleteAllFilesAndDirectories
private java.util.SortedMap<java.nio.file.Path,java.io.IOException> deleteAllFilesAndDirectories(TempDirectory.FileOperations fileOperations) throws java.io.IOException
- Throws:
java.io.IOException
-
tryToResetPermissions
private static void tryToResetPermissions(java.nio.file.Path path)
-
createIOExceptionWithAttachedFailures
private java.io.IOException createIOExceptionWithAttachedFailures(java.util.SortedMap<java.nio.file.Path,java.io.IOException> failures)
-
tryToDeleteOnExit
private java.nio.file.Path tryToDeleteOnExit(java.nio.file.Path path)
-
relativizeSafely
private java.nio.file.Path relativizeSafely(java.nio.file.Path path)
-
-