Skip to content

ResourceUtils.isUrl not considers classpath*: a valid protocol #24979

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
vkochnev opened this issue Apr 26, 2020 · 1 comment
Closed

ResourceUtils.isUrl not considers classpath*: a valid protocol #24979

vkochnev opened this issue Apr 26, 2020 · 1 comment
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@vkochnev
Copy link

Affects: \5.2.5

Discovered when trying to set spring.cloud.bootstrap.location to something like classpath*:/config/, but it didn't work because internally SpringBoot calls org.springframework.util.ResourceUtils#isUrl with supplied location and when receives false prepends it with file:. As a result it ends up with file:classpath*:/config/ in my case, which is obviously incorrect.

Expected result

ResourceUtils.isUrl("classpath*:/some/path/") == true just like in case of another pseudo-protocol classpath:.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 26, 2020
@jhoeller
Copy link
Contributor

If pattern support is desirable as well, then the method to use is org.springframework.core.io.support.ResourcePatternUtils#isUrl. The regular ResourceUtils is only really designed for single resource scenarios, not for matching patterns into multiple resources.

So if Boot intends to supports patterns there, it should simply call ResourcePatternUtils instead.

@jhoeller jhoeller self-assigned this Apr 26, 2020
@jhoeller jhoeller removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 26, 2020
@sbrannen sbrannen added the status: invalid An issue that we don't feel is valid label Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants