java.lang.Object
com.pervasive.datarush.io.Paths
A factory for creating
Path objects. Paths are commonly represented
as strings. This class provides methods for obtaining the Path
identified by such as string.-
Method Summary
Modifier and TypeMethodDescriptionstatic PathConverts aFileinto aPathobject.static PathParses a string representing a path into aPathobject.static Path[]Converts an array of files into an array of paths.Parses a string list representing a path into a list ofPath's.extractPaths(List<PathDetails> details) Convert a list ofPathDetailsobjects to a list ofPathobjects.extractPaths(List<PathDetails> details, boolean includeHidden) Convert a list ofPathDetailsobjects to a list ofPathobjects.static Map<String,FileConfiguration> Collects the default configuration for all installed providers.static FilegetIndexFile(Path path) Returns the index file associated with a temporary file path.static FileSystemProvidergetProvider(String path) Locates the provider identified by the scheme of the specified path string.
-
Method Details
-
asPath
Parses a string representing a path into aPathobject.- Parameters:
path- a string representation of a path- Returns:
- the path identified by the string
- Throws:
IllegalArgumentException- if the provided string does not represent a supported path syntaxDRException- if no configured provider could be found for the scheme
-
asPaths
Parses a string list representing a path into a list ofPath's.- Parameters:
paths- a list of string paths- Returns:
- the paths identified by the strings
- Throws:
IllegalArgumentException- if the provided strings do not represent a supported path syntaxDRException- if no configured provider could be found for the scheme
-
asPath
Converts aFileinto aPathobject. This method provides a bridge between thejava.iopackage and DataRush.- Parameters:
file- the file located by the path- Returns:
- the path identified by the file
-
asPaths
Converts an array of files into an array of paths.- Parameters:
files- the array of files- Returns:
- an array of paths
-
getIndexFile
Returns the index file associated with a temporary file path.- Parameters:
path- a temporary path- Returns:
- the index file
- Throws:
ClassCastException- if the provided path is not a temporary path
-
getProvider
Locates the provider identified by the scheme of the specified path string.- Parameters:
path- the string representation of a path for which to find the configured provider. Only a schema prefix is required; additional scheme-specific information is ignored.- Returns:
- the provider for the path scheme
- Throws:
DRException- if no configured provider could be found for the scheme
-
getDefaultConfiguration
Collects the default configuration for all installed providers.This method does not generally need to be called by end users.
FileMetaConfigurationobjects will automatically add default configuration when created.- Returns:
- a mapping of scheme to default configuration covering all installed providers
- See Also:
-
extractPaths
Convert a list ofPathDetailsobjects to a list ofPathobjects. Will not include hidden objects.- Parameters:
details- a list of file system object metadata- Returns:
- a list of paths references in the metadata
-
extractPaths
Convert a list ofPathDetailsobjects to a list ofPathobjects.- Parameters:
details- a list of file system object metadataincludeHidden- whether hidden files should be included in the list- Returns:
- a list of paths references in the metadata
-