jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Jetty 12: review `resolve()` and `getPath()` contracts in `ResourceCollection` and `MemoryResource`

Open lorban opened this issue 3 years ago • 2 comments

Jetty version(s) 12

Description Review how resolve() and getPath() are supposed to behave when directory and non-directory resources are part of a ResourceCollection, and for MemoryResource in general. Or if we want those Resource implementations at all.

lorban avatar Aug 10 '22 17:08 lorban

My personal opinion is that neither resolve() nor getPath() should ever return null, but I'm open to different opinions.

lorban avatar Aug 12 '22 11:08 lorban

If we could arrange for getPath() to never return null, then we would not need the resource class and could just use Path. However, that fails on the ResourceCollection issue that we are required to provide aggregate base resources and to do so without necessarily extracting.

However, we could have that a non-directory resource would always return a path.

Having resolve never return null is doable, but it may be that we would need to return an empty or bad resource from some resolves (or /dev/null if we must have a path).

gregw avatar Aug 12 '22 22:08 gregw

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 13 '23 00:08 github-actions[bot]

This issue has been closed due to it having no activity.

github-actions[bot] avatar Sep 13 '23 00:09 github-actions[bot]