| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_URL_PREFIX |
static String |
JAR_URL_PREFIX |
static String |
JAR_URL_SEPARATOR |
static String |
ZIP_URL_PREFIX |
| Constructor and Description |
|---|
ClassPathScanner() |
| Modifier and Type | Method and Description |
|---|---|
protected JarFile |
getJarFile(String jarFileUrl)
Resolve the given jar file URL into a JarFile object.
|
void |
scan(ClassLoader classLoader,
String path,
ScannerVisitor visitor)
Scan all directories matching path (there might be multiple locations on classpath, JAR directory, ...)
|
protected void |
scanDirectory(File pluginDir,
ScannerVisitor visitor)
Recursively scan the directory.
|
static URI |
toURI(String location)
Create a URI instance for the given location String,
replacing spaces with "%20" quotes first.
|
public static final String JAR_URL_SEPARATOR
public static final String JAR_URL_PREFIX
public static final String ZIP_URL_PREFIX
public static final String FILE_URL_PREFIX
public void scan(ClassLoader classLoader, String path, ScannerVisitor visitor) throws IOException
Scannerscan in interface ScannerclassLoader - classloader to resolve pathpath - a '/'-separated path name that identifies the resource directory.
Semantics same as ClassLoader.getResources(java.lang.String).visitor - visit each file on the pathIOException - any IO exception while scanningprotected void scanDirectory(File pluginDir, ScannerVisitor visitor) throws IOException
pluginDir - directory.visitor - callbackIOException - exception from a visitorprotected JarFile getJarFile(String jarFileUrl) throws IOException
IOExceptionpublic static URI toURI(String location) throws URISyntaxException
location - the location String to convert into a URI instanceURISyntaxException - if the location wasn't a valid URICopyright © 2018. All rights reserved.