public class URLFileSystemProvider extends Object implements FileSystemProvider
URL
objects. As such, the available set of functions
on these paths may be constrained. If richer
function is required, a scheme-specific provider
should be created for the scheme.
This provider is used as the provider of last resort when parsing path strings. Any path with an unrecognized scheme will be parsed as a URL (paths lacking schemes are always parsed as local file paths). If path is a supported URL, this provider is used.
Constructor and Description |
---|
URLFileSystemProvider()
Creates a new provider for URLs.
|
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 path)
Indicates whether the given scheme is handled by the provider.
|
public URLFileSystemProvider()
This constructor is public as a matter of implementation only.
Users should not construct a provider directly, but instead use the
static methods contained in FileClient
and Paths
.
public boolean isPathSupported(String path)
FileSystemProvider
isPathSupported
in interface FileSystemProvider
path
- an identifier for a path schemetrue
if this provider handles paths using the
scheme, false
otherwise.public Path getFileSystemPath(Path path)
FileSystemProvider
getFileSystemPath
in interface FileSystemProvider
path
- the pathpublic FileSystem getFileSystem(FileClient client, FileConfiguration configuration, Path path)
FileSystemProvider
getPath(path).getFileSystem()
,
but may be faster.getFileSystem
in interface FileSystemProvider
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 systempublic Path getPath(String path)
FileSystemProvider
FileClient
to perform
operations on the files and directories represented by
paths.getPath
in interface FileSystemProvider
path
- the path name to resolve into a path objectpublic FileConfiguration getConfigurationTemplate()
FileSystemProvider
getConfigurationTemplate
in interface FileSystemProvider
public Map<String,FileConfiguration> getDefaultConfiguration()
FileSystemProvider
A provider should return a map with entries only for schemes having default configuration; if no schemes do, an empty map should be returned.
getDefaultConfiguration
in interface FileSystemProvider
Copyright © 2020 Actian Corporation. All rights reserved.