P
- the type of path used by the provider's file systemspublic abstract class CachingBaseFileSystemProvider<P extends BasePath<P>> extends BaseFileSystemProvider<P>
BaseFileSystemProvider
that caches created file systems, allowing
at most one open file system for a given URI at a time. A new file system can
be created for a given URI after the previous one is closed.Modifier | Constructor and Description |
---|---|
protected |
CachingBaseFileSystemProvider(Class<P> pathClass) |
Modifier and Type | Method and Description |
---|---|
protected abstract URI |
checkUri(URI uri)
Checks that
uri is a valid URI for a file system from this
provider. |
FileSystem |
getFileSystem(URI uri) |
FileSystem |
newFileSystem(URI uri,
Map<String,?> env) |
protected abstract BaseFileSystem<P> |
openFileSystem(URI uri,
Map<String,?> env)
Creates a new, open file system.
|
protected Object |
uriToCacheKey(URI uri)
Converts
uri into a cache key. |
checkAccess, checkPath, createDirectory, delete, getFileAttributeView, isCompatible, isHidden, isSameFile, newByteChannel, newDirectoryStream, readAttributes, readAttributes, setAttribute
copy, createLink, createSymbolicLink, deleteIfExists, getFileStore, getPath, getScheme, installedProviders, move, newAsynchronousFileChannel, newFileChannel, newFileSystem, newInputStream, newOutputStream, readSymbolicLink
public final FileSystem newFileSystem(URI uri, Map<String,?> env) throws IOException
newFileSystem
in class FileSystemProvider
IOException
protected abstract BaseFileSystem<P> openFileSystem(URI uri, Map<String,?> env) throws IOException
uri
- a valid file system URIenv
- a possible empty map of provider specific propertiesIllegalArgumentException
- if env
does the contain require
properties or if a property value is invalidIOException
- if an I/O error occurs creating the file systempublic final FileSystem getFileSystem(URI uri)
getFileSystem
in class FileSystemProvider
protected abstract URI checkUri(URI uri)
uri
is a valid URI for a file system from this
provider.uri
- the URI to checkIllegalArgumentException
- if the URI is invalid