Class Classpath
java.lang.Object
org.apache.myfaces.view.facelets.util.Classpath
- Version:
- $Id$
- Author:
- Jacob Hookom, Roland Huss, Ales Justin (ales.justin@jboss.org)
-
Method Summary
Modifier and TypeMethodDescriptionstatic URL[]search(ClassLoader loader, String prefix, String suffix) static URL[]searchResourceNames(ClassLoader loader, String prefix) Collect, in a single classpath walk, the names of every resource entry whose name starts with the givenprefix(e.g.
-
Method Details
-
search
- Throws:
IOException
-
search
- Throws:
IOException
-
searchResourceNames
Collect, in a single classpath walk, the names of every resource entry whose name starts with the givenprefix(e.g."META-INF/"). Unlikesearch(ClassLoader, String, String)this neither filters by suffix nor resolves URLs; it only enumerates jar/directory entries once and returns their names.Callers that repeatedly search the same prefix for different suffixes (the startup config/taglib/contract providers all scan
META-INF/) can walk the classpath once, filter the returned names by suffix, and resolve the handful of matches viaClassLoader.getResources(String)- instead of re-opening and re-enumerating every jar once per suffix. Keeping only names (not eagerly-built URLs) avoids allocating a URL per entry.- Throws:
IOException
-