- java.lang.Object
-
- com.pervasive.datarush.io.Paths
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Path
asPath(File file)
Converts aFile
into aPath
object.static Path
asPath(String path)
Parses a string representing a path into aPath
object.static Path[]
asPaths(File[] files)
Converts an array of files into an array of paths.static List<Path>
asPaths(List<String> paths)
Parses a string list representing a path into a list ofPath
's.static List<Path>
extractPaths(List<PathDetails> details)
Convert a list ofPathDetails
objects to a list ofPath
objects.static List<Path>
extractPaths(List<PathDetails> details, boolean includeHidden)
Convert a list ofPathDetails
objects to a list ofPath
objects.static Map<String,FileConfiguration>
getDefaultConfiguration()
Collects the default configuration for all installed providers.static File
getIndexFile(Path path)
Returns the index file associated with a temporary file path.static FileSystemProvider
getProvider(String path)
Locates the provider identified by the scheme of the specified path string.
-
-
-
Method Detail
-
asPath
public static Path asPath(String path)
Parses a string representing a path into aPath
object.- 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
public static List<Path> asPaths(List<String> paths)
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
public static Path asPath(File file)
Converts aFile
into aPath
object. This method provides a bridge between thejava.io
package and DataRush.- Parameters:
file
- the file located by the path- Returns:
- the path identified by the file
-
asPaths
public static Path[] asPaths(File[] files)
Converts an array of files into an array of paths.- Parameters:
files
- the array of files- Returns:
- an array of paths
-
getIndexFile
public static File getIndexFile(Path path)
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
public static FileSystemProvider getProvider(String path)
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
public static Map<String,FileConfiguration> getDefaultConfiguration()
Collects the default configuration for all installed providers.This method does not generally need to be called by end users.
FileMetaConfiguration
objects will automatically add default configuration when created.- Returns:
- a mapping of scheme to default configuration covering all installed providers
- See Also:
FileSystemProvider.getDefaultConfiguration()
-
extractPaths
public static List<Path> extractPaths(List<PathDetails> details)
Convert a list ofPathDetails
objects to a list ofPath
objects. Will not include hidden objects.- Parameters:
details
- a list of file system object metadata- Returns:
- a list of paths references in the metadata
-
extractPaths
public static List<Path> extractPaths(List<PathDetails> details, boolean includeHidden)
Convert a list ofPathDetails
objects to a list ofPath
objects.- 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
-
-