Top Inners Fields Constructors Methods
org.junit.platform.commons.util

pack-priv final Class CloseablePath

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Static Imports
java.util.Collections.emptyMap

Since
1.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
private static class

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final Closeable
private static final String
private static final String
pack-priv static final String
private static final String
private static final ConcurrentMap<URI, CloseablePath.ManagedFileSystem>
private static final Closeable
private final Path

Constructor Summary

AccessConstructor and Description
private
CloseablePath(Path path, Closeable delegate)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

pack-priv static CloseablePath
create(URI uri)

pack-priv static CloseablePath
create(URI uri, CloseablePath.FileSystemProvider fileSystemProvider)

private static CloseablePath
public Path
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closedback to summary
private final AtomicBoolean closed
delegateback to summary
private final Closeable delegate
FILE_URI_SCHEMEback to summary
private static final String FILE_URI_SCHEME
JAR_FILE_EXTENSIONback to summary
private static final String JAR_FILE_EXTENSION
JAR_URI_SCHEMEback to summary
pack-priv static final String JAR_URI_SCHEME
JAR_URI_SEPARATORback to summary
private static final String JAR_URI_SEPARATOR
MANAGED_FILE_SYSTEMSback to summary
private static final ConcurrentMap<URI, CloseablePath.ManagedFileSystem> MANAGED_FILE_SYSTEMS
NULL_CLOSEABLEback to summary
private static final Closeable NULL_CLOSEABLE
pathback to summary
private final Path path

Constructor Detail

CloseablePathback to summary
private CloseablePath(Path path, Closeable delegate)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
createback to summary
pack-priv static CloseablePath create(URI uri) throws URISyntaxException
createback to summary
pack-priv static CloseablePath create(URI uri, CloseablePath.FileSystemProvider fileSystemProvider) throws URISyntaxException
createForJarFileSystemback to summary
private static CloseablePath createForJarFileSystem(URI jarUri, Function<FileSystem, Path> pathProvider, CloseablePath.FileSystemProvider fileSystemProvider)
getPathback to summary
public Path getPath()
org.junit.platform.commons.util back to summary

pack-priv Interface CloseablePath.FileSystemProvider


Method Summary

Modifier and TypeMethod and Description
public FileSystem

Method Detail

newFileSystemback to summary
public FileSystem newFileSystem(URI uri) throws IOException
org.junit.platform.commons.util back to summary

private Class CloseablePath.ManagedFileSystem

extends Object
Class Inheritance
  • java.lang.Object
  • org.junit.platform.commons.util.CloseablePath.ManagedFileSystem

Field Summary

Modifier and TypeField and Description
private final FileSystem
private final URI
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
private @Nullable CloseablePath.ManagedFileSystem
private CloseablePath.ManagedFileSystem
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fileSystemback to summary
private final FileSystem fileSystem
jarUriback to summary
private final URI jarUri
referenceCountback to summary
private final AtomicInteger referenceCount

Constructor Detail

ManagedFileSystemback to summary
pack-priv ManagedFileSystem(URI jarUri, CloseablePath.FileSystemProvider fileSystemProvider)

Method Detail

closeback to summary
private void close()
releaseback to summary
private @Nullable CloseablePath.ManagedFileSystem release()
retainback to summary
private CloseablePath.ManagedFileSystem retain()