Class ClasspathUrlFinder

java.lang.Object
org.scannotation.ClasspathUrlFinder

public class ClasspathUrlFinder extends Object
Various functions to locate URLs to scan
Version:
$Revision: 1 $
  • Constructor Details

    • ClasspathUrlFinder

      public ClasspathUrlFinder()
  • Method Details

    • findResourceBases

      public static URL[] findResourceBases(String baseResource, ClassLoader loader)
      Find the classpath URLs for a specific classpath resource. The classpath URL is extracted from loader.getResources() using the baseResource.
      Parameters:
      baseResource -
      Returns:
    • findResourceBases

      public static URL[] findResourceBases(String baseResource)
      Find the classpath URLs for a specific classpath resource. The classpath URL is extracted from loader.getResources() using the baseResource.
      Parameters:
      baseResource -
      Returns:
    • findResourceBase

      private static URL findResourceBase(URL url, String baseResource)
    • findResourceBase

      public static URL findResourceBase(String baseResource)
      Find the classpath URL for a specific classpath resource. The classpath URL is extracted from Thread.currentThread().getContextClassLoader().getResource() using the baseResource.
      Parameters:
      baseResource -
      Returns:
    • findResourceBase

      public static URL findResourceBase(String baseResource, ClassLoader loader)
      Find the classpath URL for a specific classpath resource. The classpath URL is extracted from loader.getResource() using the baseResource.
      Parameters:
      baseResource -
      loader -
      Returns:
    • findClassBase

      public static URL findClassBase(Class clazz)
      Find the classpath for the particular class
      Parameters:
      clazz -
      Returns:
    • findClassPaths

      public static URL[] findClassPaths()
      Uses the java.class.path system property to obtain a list of URLs that represent the CLASSPATH
      Returns:
    • findClassPaths

      public static URL[] findClassPaths(String... paths)
      Uses the java.class.path system property to obtain a list of URLs that represent the CLASSPATH

      paths is used as a filter to only include paths that have the specific relative file within it

      Parameters:
      paths - comma list of files that should exist in a particular path
      Returns: