Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #8474 - Jetty 12 - Resource.list() API change + Resource.getFileName() addition #8582

Merged
merged 7 commits into from
Sep 14, 2022

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Sep 12, 2022

Per discussion around Issue #8474, the API of Resource.list() has changed.

  • Signature of return has changed from List<String> to List<Resource>
  • Always returns all hits, leaving unique behavior to caller of the API to do.

New API Resource.getFileName() has been implemented to make users of the above API easier to implement.

When it comes to uniqueness of the entries in the list, that's only relevant for the ResourceListing class.
All other callers don't need (or want) the uniqueness behaviors.

The uniqueness algorithm in ResourceListing for this PR is "first hit".
Other algorithms suggested (eg: "most recently updated" / "largest entry" / "last hit" / etc) are not implemented in this PR.

@joakime joakime requested review from sbordet and lorban September 12, 2022 19:40
@joakime joakime self-assigned this Sep 12, 2022
* Introduce Resource.getFileName and use it
* Correct signature of Resource.list and use it

Signed-off-by: Joakim Erdfelt <[email protected]>
@joakime joakime force-pushed the fix/jetty-12-resource-list-sig-change branch from 72100c4 to 237f2f4 Compare September 13, 2022 15:22
@joakime joakime changed the title Issue #8474 - Jetty 12 - Resource.list() API change Issue #8474 - Jetty 12 - Resource.list() API change + Resource.getFileName() addition Sep 14, 2022
@joakime joakime requested a review from sbordet September 14, 2022 19:02
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart the 3 nits, but please fix them..

return r.getURI().toURL();
}

// Resource was returned, but none-existed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You meant non-existent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

return resource.getURI().toURL();
// Resource was returned, but none-existed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You meant non-existent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

return resource.getURI().toURL();
// Resource was returned, but none-existed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You meant non-existent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@joakime joakime merged commit 9668d61 into jetty-12.0.x Sep 14, 2022
@joakime joakime deleted the fix/jetty-12-resource-list-sig-change branch September 14, 2022 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants