public interface FileSystemProvider
FileSystemProvider
serves two primary purposes:
Path
objects for the schemes
it supports.Paths
and FileClient
are used. These handle paths generically,
whereas a provider can only deal with paths it knows how to support.
To add a new path scheme/file system, it is necessary to provide
an implementation of this interface. For the scheme to be supported
by the methods in Paths
, the implementation class must be registered
as service for com.pervasive.datarush.io.FileSystemProvider
in the
META-INF of the jar containing the class.
Modifier and Type | Method and Description |
---|---|
FileConfiguration |
getConfigurationTemplate()
Returns a non-populated configuration object to server as a template that the user
must fill-in.
|
Map<String,FileConfiguration> |
getDefaultConfiguration()
Gets default configuration for the schemes handled by the provider.
|
FileSystem |
getFileSystem(FileClient client,
FileConfiguration configuration,
Path path)
Gets the file system identified by the path.
|
Path |
getFileSystemPath(Path path)
Returns the filesystem root path associated with the given path.
|
Path |
getPath(String path)
Gets the path identified by the given string.
|
boolean |
isPathSupported(String scheme)
Indicates whether the given scheme is handled by the provider.
|
boolean isPathSupported(String scheme)
scheme
- an identifier for a path schemetrue
if this provider handles paths using the
scheme, false
otherwise.FileSystem getFileSystem(FileClient client, FileConfiguration configuration, Path path)
getPath(path).getFileSystem()
,
but may be faster.client
- a file client. most implementations will ignore this parameter.
"meta-filesystems" ( those than can span filesystems ) may need the file client.configuration
- the configuration for this filesystempath
- a path identifying a file on the file systemIllegalArgumentException
- if the path is not
prefixed with a scheme supported by the providerPath getPath(String path)
FileClient
to perform
operations on the files and directories represented by
paths.path
- the path name to resolve into a path objectIllegalArgumentException
- if the path is not
prefixed with a scheme supported by the providerMap<String,FileConfiguration> getDefaultConfiguration()
A provider should return a map with entries only for schemes having default configuration; if no schemes do, an empty map should be returned.
FileConfiguration getConfigurationTemplate()
Copyright © 2020 Actian Corporation. All rights reserved.