Skip to content

Use encoded file URI when reading persisted NcML aggregation cache#1585

Merged
lesserwhirls merged 2 commits into
Unidata:maint-5.xfrom
387809109:#delimiter-aggregation-cache-URI
Jul 21, 2026
Merged

Use encoded file URI when reading persisted NcML aggregation cache#1585
lesserwhirls merged 2 commits into
Unidata:maint-5.xfrom
387809109:#delimiter-aggregation-cache-URI

Conversation

@387809109

@387809109 387809109 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

The generated cache filename is:

/path/test1.ncml#delimiter

This is a valid Linux filename.
AggregationExisting.persistRead() parsed the cache using:

Parse.readRootElement("file:" + cacheFile.getPath())

For a URL such as file:/path/test1.ncml#delimiter the #delimiter portion is interpreted as a URI fragment.

The XML parser therefore attempted to open /path/test1.ncml instead of /path/test1.ncml#delimiter
The resulting IOException was caught and persistRead() returned silently.

replaced that part with Parse.readRootElement(cacheFile.toURI().toString())
File.toURI() encodes the literal # as %23.

The resulting URI refers to the real file:
test1.ncml%23delimiter

PR Checklist

  • Link to any issues that the PR addresses
  • Add labels
  • Open as a draft PR
    until ready for review
  • Make sure GitHub tests pass
  • Mark PR as "Ready for Review"

@387809109

Copy link
Copy Markdown
Contributor Author

the cache-sensitive TestNetcdfFileCache.testNetcdfFileCache failure appears unrelated to this one-line URI change.

@387809109
387809109 marked this pull request as ready for review July 21, 2026 05:50
@387809109
387809109 requested a review from lesserwhirls as a code owner July 21, 2026 05:50
@lesserwhirls lesserwhirls added bug Something isn't working NcML Issues related to NcML labels Jul 21, 2026
@lesserwhirls lesserwhirls added this to the 5.11.0 milestone Jul 21, 2026
@lesserwhirls
lesserwhirls merged commit 411d3de into Unidata:maint-5.x Jul 21, 2026
15 checks passed
@lesserwhirls

Copy link
Copy Markdown
Member

Thank you for your contributions!

@387809109
387809109 deleted the #delimiter-aggregation-cache-URI branch July 21, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working NcML Issues related to NcML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants