Package org.elasticsearch.core
Class PathUtils
java.lang.Object
org.elasticsearch.core.PathUtils
Utilities for creating a Path from names,
or accessing the default FileSystem.
This class allows the default filesystem to be changed during tests.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Path
Returns aPath
from name components.static Path
Returns aPath
from a URIstatic Path
Tries to resolve the given path against the list of available roots.static Path
Tries to resolve the given file uri against the list of available roots.static FileSystem
Returns the default FileSystem.
-
Method Details
-
get
Returns aPath
from name components.This works just like
Paths.get()
. Remember: just likePaths.get()
this is NOT A STRING CONCATENATION UTILITY FUNCTION.Remember: this should almost never be used. Usually resolve a path against an existing one!
-
get
Returns aPath
from a URIThis works just like
Paths.get()
.Remember: this should almost never be used. Usually resolve a path against an existing one!
-
get
Tries to resolve the given path against the list of available roots. If path starts with one of the listed roots, it returned back by this method, otherwise null is returned. -
get
Tries to resolve the given file uri against the list of available roots. If uri starts with one of the listed roots, it returned back by this method, otherwise null is returned. -
getDefaultFileSystem
Returns the default FileSystem.
-