Package org.junit.platform.commons.util
Class CloseablePath
- java.lang.Object
-
- org.junit.platform.commons.util.CloseablePath
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
final class CloseablePath extends java.lang.Object implements java.io.Closeable- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.Closeabledelegateprivate static java.lang.StringFILE_URI_SCHEMEprivate static java.lang.StringJAR_FILE_EXTENSIONprivate static java.lang.StringJAR_URI_SCHEMEprivate static java.lang.StringJAR_URI_SEPARATORprivate static java.io.CloseableNULL_CLOSEABLEprivate java.nio.file.Pathpath
-
Constructor Summary
Constructors Modifier Constructor Description privateCloseablePath(java.nio.file.Path path, java.io.Closeable delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()(package private) static CloseablePathcreate(java.net.URI uri)private static CloseablePathcreateForJarFileSystem(java.net.URI jarUri, java.util.function.Function<java.nio.file.FileSystem,java.nio.file.Path> pathProvider)java.nio.file.PathgetPath()
-
-
-
Field Detail
-
FILE_URI_SCHEME
private static final java.lang.String FILE_URI_SCHEME
- See Also:
- Constant Field Values
-
JAR_URI_SCHEME
private static final java.lang.String JAR_URI_SCHEME
- See Also:
- Constant Field Values
-
JAR_FILE_EXTENSION
private static final java.lang.String JAR_FILE_EXTENSION
- See Also:
- Constant Field Values
-
JAR_URI_SEPARATOR
private static final java.lang.String JAR_URI_SEPARATOR
- See Also:
- Constant Field Values
-
NULL_CLOSEABLE
private static final java.io.Closeable NULL_CLOSEABLE
-
path
private final java.nio.file.Path path
-
delegate
private final java.io.Closeable delegate
-
-
Method Detail
-
create
static CloseablePath create(java.net.URI uri) throws java.io.IOException, java.net.URISyntaxException
- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
createForJarFileSystem
private static CloseablePath createForJarFileSystem(java.net.URI jarUri, java.util.function.Function<java.nio.file.FileSystem,java.nio.file.Path> pathProvider) throws java.io.IOException
- Throws:
java.io.IOException
-
getPath
public java.nio.file.Path getPath()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-