- java.lang.Object
-
- com.pervasive.datarush.io.LocalFileSystemProvider
-
- All Implemented Interfaces:
FileSystemProvider
public class LocalFileSystemProvider extends Object implements FileSystemProvider
Provides access to the local file system. Local paths follow the conventions of the operating system on which they are created. Thus on Windows, paths may be prefixed by a drive letter and use backslashes as path element separators (although slashes are also supported). This is similar to the behavior ofFile
.Local file system paths do not require a scheme. Path strings without schemes are always assumed to be local paths. However, for interoperability with URIs, the
file
scheme is also recognized for local paths.
-
-
Constructor Summary
Constructors Constructor Description LocalFileSystemProvider()
Creates a new provider for the local file system.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
LocalFileSystemProvider
public LocalFileSystemProvider()
Creates a new provider for the local file system.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
andPaths
.
-
-
Method Detail
-
isPathSupported
public boolean isPathSupported(String path)
Description copied from interface:FileSystemProvider
Indicates whether the given scheme is handled by the provider.- Specified by:
isPathSupported
in interfaceFileSystemProvider
- Parameters:
path
- an identifier for a path scheme- Returns:
true
if this provider handles paths using the scheme,false
otherwise.
-
getFileSystem
public FileSystem getFileSystem(FileClient client, FileConfiguration configuration, Path path)
Description copied from interface:FileSystemProvider
Gets the file system identified by the path. The path identifies a file on the file system; the file's file system is returned. This is equivalent to callinggetPath(path).getFileSystem()
, but may be faster.- Specified by:
getFileSystem
in interfaceFileSystemProvider
- Parameters:
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 system- Returns:
- the requested file system object
-
getPath
public Path getPath(String path)
Description copied from interface:FileSystemProvider
Gets the path identified by the given string. The resulting path represents a location in an abstract file system. Use the methods inFileClient
to perform operations on the files and directories represented by paths.- Specified by:
getPath
in interfaceFileSystemProvider
- Parameters:
path
- the path name to resolve into a path object- Returns:
- the requested path object
-
getFileSystemPath
public Path getFileSystemPath(Path path)
Description copied from interface:FileSystemProvider
Returns the filesystem root path associated with the given path.- Specified by:
getFileSystemPath
in interfaceFileSystemProvider
- Parameters:
path
- the path- Returns:
- the root path
-
getConfigurationTemplate
public FileConfiguration getConfigurationTemplate()
Description copied from interface:FileSystemProvider
Returns a non-populated configuration object to server as a template that the user must fill-in.- Specified by:
getConfigurationTemplate
in interfaceFileSystemProvider
- Returns:
- a configuration template
-
getDefaultConfiguration
public Map<String,FileConfiguration> getDefaultConfiguration()
Description copied from interface:FileSystemProvider
Gets default configuration for the schemes handled by the provider. Default configuration is inherited from the execution environment.A provider should return a map with entries only for schemes having default configuration; if no schemes do, an empty map should be returned.
- Specified by:
getDefaultConfiguration
in interfaceFileSystemProvider
- Returns:
- a mapping of schemes to default configuration
-
-