static class TempDirectory.CloseablePath extends java.lang.Object implements ExtensionContext.Store.CloseableResource
| Modifier and Type | Field and Description |
|---|---|
private CleanupMode |
cleanupMode |
private java.nio.file.Path |
dir |
private ExtensionContext |
extensionContext |
private TempDirFactory |
factory |
private static Logger |
logger |
| Constructor and Description |
|---|
CloseablePath(TempDirFactory factory,
CleanupMode cleanupMode,
AnnotatedElementContext elementContext,
ExtensionContext extensionContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close underlying resources.
|
private java.io.IOException |
createIOExceptionWithAttachedFailures(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) |
(package private) java.nio.file.Path |
get() |
private java.nio.file.Path |
relativizeSafely(java.nio.file.Path path) |
private java.nio.file.Path |
tryToDeleteOnExit(java.nio.file.Path path) |
private static void |
tryToResetPermissions(java.nio.file.Path path) |
private static final Logger logger
private final java.nio.file.Path dir
private final TempDirFactory factory
private final CleanupMode cleanupMode
private final ExtensionContext extensionContext
CloseablePath(TempDirFactory factory, CleanupMode cleanupMode, AnnotatedElementContext elementContext, ExtensionContext extensionContext) throws java.lang.Exception
java.lang.Exceptionjava.nio.file.Path get()
public void close()
throws java.io.IOException
ExtensionContext.Store.CloseableResourceclose in interface ExtensionContext.Store.CloseableResourcejava.io.IOExceptionprivate java.util.SortedMap<java.nio.file.Path,java.io.IOException> deleteAllFilesAndDirectories(TempDirectory.FileOperations fileOperations) throws java.io.IOException
java.io.IOExceptionprivate static void tryToResetPermissions(java.nio.file.Path path)
private java.io.IOException createIOExceptionWithAttachedFailures(java.util.SortedMap<java.nio.file.Path,java.io.IOException> failures)
private java.nio.file.Path tryToDeleteOnExit(java.nio.file.Path path)
private java.nio.file.Path relativizeSafely(java.nio.file.Path path)