Class Classpath

java.lang.Object
org.apache.myfaces.view.facelets.util.Classpath

public final class Classpath extends Object
Version:
$Id$
Author:
Jacob Hookom, Roland Huss, Ales Justin (ales.justin@jboss.org)
  • Method Details

    • search

      public static URL[] search(String prefix, String suffix) throws IOException
      Throws:
      IOException
    • search

      public static URL[] search(ClassLoader loader, String prefix, String suffix) throws IOException
      Throws:
      IOException
    • searchResourceNames

      public static Set<String> searchResourceNames(ClassLoader loader, String prefix) throws IOException
      Collect, in a single classpath walk, the names of every resource entry whose name starts with the given prefix (e.g. "META-INF/"). Unlike search(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 via ClassLoader.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