{"action":"created","issue":{"url":"https://api.github.com/repos/google/guava/issues/2038","labels_url":"https://api.github.com/repos/google/guava/issues/2038/labels{/name}","comments_url":"https://api.github.com/repos/google/guava/issues/2038/comments","events_url":"https://api.github.com/repos/google/guava/issues/2038/events","html_url":"https://github.com/google/guava/issues/2038","id":69568543,"number":2038,"title":"Add a way to fine-grain find resources","user":{"login":"ogregoire","id":666970,"avatar_url":"https://avatars.githubusercontent.com/u/666970?v=3","gravatar_id":"","url":"https://api.github.com/users/ogregoire","html_url":"https://github.com/ogregoire","followers_url":"https://api.github.com/users/ogregoire/followers","following_url":"https://api.github.com/users/ogregoire/following{/other_user}","gists_url":"https://api.github.com/users/ogregoire/gists{/gist_id}","starred_url":"https://api.github.com/users/ogregoire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogregoire/subscriptions","organizations_url":"https://api.github.com/users/ogregoire/orgs","repos_url":"https://api.github.com/users/ogregoire/repos","events_url":"https://api.github.com/users/ogregoire/events{/privacy}","received_events_url":"https://api.github.com/users/ogregoire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-04-20T11:41:07Z","updated_at":"2015-04-23T15:10:07Z","closed_at":null,"body":"I've just tried to use `ClassPath.from(MyClass.class.getClassLoader()).getResources()` as a kind of alternative to the aging [`ResourceFinder`](http://geronimo.apache.org/maven/xbean/3.6/xbean-finder/apidocs/org/apache/xbean/finder/ResourceFinder.html) (naming sometimes surprising -- `findString` for instance, dismissing generics when searching for implementations) but that call always returned the whole JDK, probably because the parent `ClassLoader` is also added (according to the source code of `ClassPath`: it is not specified in the Javadoc). My goal here is to have something faster than looping over 20k entries over and over.\r\n\r\nWhy can't I do that myself wrapping my ideas over `ClassPath.from(...).getResources()`, by iterating and checking the URL? Because for a few `ResourceInfo` entries from the JDK, the `url()` method cannot be invoked without generating a `NullPointerException`. This starts to be a lot of undocumented features for my use case.\r\n\r\nWould it be possible to specify a notion of \"exactly the specified `ClassLoaders` or URLs\" (like `jar:` and `file:` urls)? Then with filters and mapping, it's rather trivial for us to extract whatever resource we really want. To be honest, what I'd really want is a modern and efficient `ResourceFinder`."},"comment":{"url":"https://api.github.com/repos/google/guava/issues/comments/95619776","html_url":"https://github.com/google/guava/issues/2038#issuecomment-95619776","issue_url":"https://api.github.com/repos/google/guava/issues/2038","id":95619776,"user":{"login":"fluentfuture","id":3457808,"avatar_url":"https://avatars.githubusercontent.com/u/3457808?v=3","gravatar_id":"","url":"https://api.github.com/users/fluentfuture","html_url":"https://github.com/fluentfuture","followers_url":"https://api.github.com/users/fluentfuture/followers","following_url":"https://api.github.com/users/fluentfuture/following{/other_user}","gists_url":"https://api.github.com/users/fluentfuture/gists{/gist_id}","starred_url":"https://api.github.com/users/fluentfuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluentfuture/subscriptions","organizations_url":"https://api.github.com/users/fluentfuture/orgs","repos_url":"https://api.github.com/users/fluentfuture/repos","events_url":"https://api.github.com/users/fluentfuture/events{/privacy}","received_events_url":"https://api.github.com/users/fluentfuture/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T15:10:07Z","updated_at":"2015-04-23T15:10:07Z","body":"Fyi, in the next version, NulPointerException is going to be changed to NoSuchElementException to make it more friendly for clients to catch. "}}