Skip to content

Create UrlResource factory methods that throw unchecked exceptions #28501

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

Closed
sbrannen opened this issue May 22, 2022 · 0 comments
Closed

Create UrlResource factory methods that throw unchecked exceptions #28501

sbrannen opened this issue May 22, 2022 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented May 22, 2022

Overview

UrlResource constructors throw checked exceptions which makes it difficult to use them in java.util.Stream and java.util.Optional APIs or other scenarios when a checked IOException is undesirable.

Proposal

To support such use cases, we should introduce factory methods in UrlResource that throw UncheckedIOException, initially for the constructor variants that accept a URI or String.

Related Issues

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels May 22, 2022
@sbrannen sbrannen added this to the 6.0.0-M5 milestone May 22, 2022
@sbrannen sbrannen self-assigned this May 22, 2022
@sbrannen sbrannen changed the title Create UrlResource factory methods that throw UncheckedIOException Create UrlResource factory methods that throw unchecked exceptions May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant