Skip to content

Introduce classpath*: support for ResourceLoader#getResource with fully specified resource path #36415

@jhoeller

Description

@jhoeller

Inspired by #36292, generalizing classpath*: support for a fully specified resource path without pattern resolution:

Non-pattern classpath*: support could be built into (Default)ResourceLoader, so that a getResource("classpath*:messages.properties") call does not fail like right now but rather expose a merged Resource handle with InputStream access to all same-named resources on the classpath.

This implies moving the CLASSPATH_ALL_URL_PREFIX constant to the top-level ResourceLoader interface with corresponding behavior for fully specified URL locations in a plain getResource call - next to the existing pattern-aware semantics for getResources in ResourcePatternResolver which would remain unchanged.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions