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.Closeable
delegate
private static java.lang.String
FILE_URI_SCHEME
private static java.lang.String
JAR_FILE_EXTENSION
private static java.lang.String
JAR_URI_SCHEME
private static java.lang.String
JAR_URI_SEPARATOR
private static java.io.Closeable
NULL_CLOSEABLE
private java.nio.file.Path
path
-
Constructor Summary
Constructors Modifier Constructor Description private
CloseablePath(java.nio.file.Path path, java.io.Closeable delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
(package private) static CloseablePath
create(java.net.URI uri)
private static CloseablePath
createForJarFileSystem(java.net.URI jarUri, java.util.function.Function<java.nio.file.FileSystem,java.nio.file.Path> pathProvider)
java.nio.file.Path
getPath()
-
-
-
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.IOException
java.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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-