Package org.scannotation
Class ClasspathUrlFinder
java.lang.Object
org.scannotation.ClasspathUrlFinder
Various functions to locate URLs to scan
- Version:
- $Revision: 1 $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URL
findClassBase
(Class clazz) Find the classpath for the particular classstatic URL[]
Uses the java.class.path system property to obtain a list of URLs that represent the CLASSPATHstatic URL[]
findClassPaths
(String... paths) Uses the java.class.path system property to obtain a list of URLs that represent the CLASSPATHstatic URL
findResourceBase
(String baseResource) Find the classpath URL for a specific classpath resource.static URL
findResourceBase
(String baseResource, ClassLoader loader) Find the classpath URL for a specific classpath resource.private static URL
findResourceBase
(URL url, String baseResource) static URL[]
findResourceBases
(String baseResource) Find the classpath URLs for a specific classpath resource.static URL[]
findResourceBases
(String baseResource, ClassLoader loader) Find the classpath URLs for a specific classpath resource.
-
Constructor Details
-
ClasspathUrlFinder
public ClasspathUrlFinder()
-
-
Method Details
-
findResourceBases
Find the classpath URLs for a specific classpath resource. The classpath URL is extracted from loader.getResources() using the baseResource.- Parameters:
baseResource
-- Returns:
-
findResourceBases
Find the classpath URLs for a specific classpath resource. The classpath URL is extracted from loader.getResources() using the baseResource.- Parameters:
baseResource
-- Returns:
-
findResourceBase
-
findResourceBase
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
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
Find the classpath for the particular class- Parameters:
clazz
-- Returns:
-
findClassPaths
Uses the java.class.path system property to obtain a list of URLs that represent the CLASSPATH- Returns:
-
findClassPaths
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:
-