public static Collection<URL> forWebInfLib(final ServletContext servletContext) {
        final Collection<URL> urls = new ArrayList<URL>();
        Set<?> resourcePaths = servletContext.getResourcePaths("/WEB-INF/lib");
        if (resourcePaths == null) {
            return urls;
        }
        for (Object urlString : resourcePaths) {
            try {
                urls.add(servletContext.getResource((String) urlString));
            } catch (MalformedURLException e) { /*fuck off*/ }
        }
        return distinctUrls(urls);
    }
public static Collection < URL > forWebInfLib ( final ServletContext servletContext ) { final Collection < URL > urls = new ArrayList < URL > ( ) ; Set < ? > resourcePaths = servletContext . getResourcePaths ( "/WEB-INF/lib" ) ; if ( resourcePaths == null ) { return urls ; } for ( Object urlString : resourcePaths ) { try { urls . add ( servletContext . getResource ( ( String ) urlString ) ) ; } catch ( MalformedURLException e ) { } } return distinctUrls ( urls ) ; }
Returns a distinct collection of URLs based on the {@code WEB-INF/lib} folder.
<p>
This finds the URLs using the {@link ServletContext}.
<p>
The returned URLs retains the order of the given {@code classLoaders}.

@return the collection of URLs, not null