/** * Finds the resource with the given name. * @see {@link #loadClass(String)} for loading order * * @return null when no resource is found */ public URL getResource(String name) { return load(stripLeadingSlash(name), ResourceLoaderDispatcher.INSTANCE).orNull(); }
/** * Finds all the resources with the given name. * Aborts going through subsequent fallbacks when it finds at least one resource. * @see {@link #loadClass(String)} for loading order * * @return empty {@link Iterable} when no resources find */ public Iterable<URL> getResources(String name) { Maybe<Iterable<URL>> ret = load(stripLeadingSlash(name), MultipleResourceLoaderDispatcher.INSTANCE); if (ret.isPresent()) { return ret.get(); } else { return ImmutableList.of(); } }