Add remote file filtering for XBeanBrokerFactory#1950
Merged
cshannon merged 2 commits intoapache:mainfrom Apr 21, 2026
Merged
Conversation
This expands on the previous work in apache#1910 to add treat remote files as a separate protocol category that can be controlled independently of regular files when loading resources. By default remote files will be disabled. Follow on to apache#1910
jbonofre
previously approved these changes
Apr 21, 2026
Member
jbonofre
left a comment
There was a problem hiding this comment.
It looks good. I just have a doubt about isQualifiedRemoteFile() test.
| } | ||
|
|
||
| private static boolean isQualifiedRemoteFile(String uri) { | ||
| return uri.startsWith(FILE_PROTOCOL + "://") || uri.startsWith(FILE_PROTOCOL + ":\\\\"); |
Member
There was a problem hiding this comment.
I guess file:/// match here, meaning it's local but not remove. Should we not check the /// to be sure we are actually local?
Suggested change
| return uri.startsWith(FILE_PROTOCOL + "://") || uri.startsWith(FILE_PROTOCOL + ":\\\\"); | |
| return (uri.startsWith(FILE_PROTOCOL + "://") && !uri.startsWith(FILE_PROTOCOL + ":///")) | |
| || uri.startsWith(FILE_PROTOCOL + ":\\\\"); |
Contributor
Author
There was a problem hiding this comment.
That is a good point but I think the safest thing here is to just only allow using the single slash or relative path. No one needs to use file:/// they can just use file:/ and that will simplify things and prevent any bugs.
We can make a note of that when this is released and we write some documentation.
Member
There was a problem hiding this comment.
Yes, that works for me. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This expands on the previous work in #1910 to add treat remote files as a separate protocol category that can be controlled independently of regular files when loading resources. By default remote files will be disabled.
Follow on to #1910