userzhy opened a new pull request, #7075:
URL: https://github.com/apache/opendal/pull/7075
# Which issue does this PR close?
Closes #7066.
# Rationale for this change
The recently-added URI feature uses OpenDAL's existing idea of a scheme,
which in most cases matches the commonly-used schemes for different services.
However, the filesystem service uses the scheme `fs`, while standard file
system URIs use the scheme `file`. This is confusing for users who expect to
use `file://` URIs.
By adding `file` as an alias for `fs`, users can use the standard URI scheme
while maintaining backward compatibility with the existing `fs` scheme.
# What changes are included in this PR?
- Added `FILE_SCHEME` constant (`"file"`) in `core/services/fs/src/lib.rs`
- Registered `file` as an alias for `Fs` service in the operator registry
- Added a test case to verify `file://` URIs work correctly
# Are there any user-facing changes?
Yes. Users can now use the standard `file://` URI scheme to create
filesystem operators, in addition to the existing `fs://` scheme. This is fully
backward compatible.
```rust
// Both of these now work:
let op1 = Operator::from_uri("fs:///tmp/data")?;
let op2 = Operator::from_uri("file:///tmp/data")?;
```
# AI Usage Statement
This PR was developed with the assistance of Claude (Anthropic).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]