Class StoragePath
java.lang.Object
org.elasticsearch.xpack.esql.datasources.spi.StoragePath
Represents a location in a storage system.
Uses URI-like format: scheme://[userInfo@]host[:port][/path]
Unlike java.net.URI, this class:
- Does not perform URL encoding/decoding
- Has simpler parsing rules suitable for blob storage keys
- Provides convenient methods for path manipulation
Note: glob pattern detection (
isPattern()) only inspects the path component.
Glob characters in the scheme or authority (e.g. s3://bucket-*/data/) are
not detected as patterns and will be treated as literal text.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionappendPath(String element) booleanstatic StringConverts a local filesystemPathto a properly formattedfile://URI string.globPart()Returns the glob portion of the path (everything after the prefix directory).inthashCode()host()booleanReturns true if the path contains glob metacharacters: *, ?, {, [Returns the path component adjusted for use as a local filesystem path.static StoragePathpath()Returns a new StoragePath truncated to the longest non-pattern prefix directory.intport()scheme()toString()
-
Field Details
-
SCHEME_SEPARATOR
- See Also:
-
PATH_SEPARATOR
- See Also:
-
PORT_SEPARATOR
- See Also:
-
GLOB_METACHARACTERS
public static final char[] GLOB_METACHARACTERS
-
-
Method Details
-
fileUri
Converts a local filesystemPathto a properly formattedfile://URI string. Normalizes Windows backslashes and ensures the URI has three slashes (file:///). -
of
-
scheme
-
host
-
port
public int port() -
path
-
localPath
Returns the path component adjusted for use as a local filesystem path. On Windows, file:// URIs produce paths like/C:/dir/filewhere the leading slash is invalid for the OS. This method strips it when a drive letter is detected so the result can be passed toPathUtils.get()safely. -
objectName
-
parentDirectory
-
appendPath
-
isPattern
public boolean isPattern()Returns true if the path contains glob metacharacters: *, ?, {, [ -
patternPrefix
Returns a new StoragePath truncated to the longest non-pattern prefix directory. e.g. "s3://b/data/2024/*.parquet" -> "s3://b/data/2024/" -
globPart
Returns the glob portion of the path (everything after the prefix directory). e.g. "s3://b/data/2024/*.parquet" -> "*.parquet" -
toString
-
equals
-
hashCode
public int hashCode()
-