public class JarScanner extends Object implements PluginContentScanner
Modifier and Type | Class and Description |
---|---|
static class |
JarScanner.ClassData |
PluginContentScanner.ExtensionMetaData
EMPTY
Constructor and Description |
---|
JarScanner(File srcFile) |
Modifier and Type | Method and Description |
---|---|
Enumeration<PluginEntry> |
entries()
Return all the resources inside a plugin
|
List<String> |
findSubClassesOf(Class<?> superClass) |
com.google.common.base.Optional<PluginEntry> |
getEntry(String resourcePath)
Return the plugin resource associated to a path
|
InputStream |
getInputStream(PluginEntry entry)
Return the InputStream of the resource entry
|
Manifest |
getManifest()
Return the plugin meta-data manifest
|
Map<Class<? extends Annotation>,Iterable<PluginContentScanner.ExtensionMetaData>> |
scan(String pluginName,
Iterable<Class<? extends Annotation>> annotations)
Scans the plugin for declared public annotated classes
|
public JarScanner(File srcFile) throws IOException
IOException
public Map<Class<? extends Annotation>,Iterable<PluginContentScanner.ExtensionMetaData>> scan(String pluginName, Iterable<Class<? extends Annotation>> annotations) throws InvalidPluginException
PluginContentScanner
scan
in interface PluginContentScanner
pluginName
- the plugin nameannotations
- annotations declared by the plugin classesInvalidPluginException
- if the plugin is not valid or corruptedpublic List<String> findSubClassesOf(Class<?> superClass) throws IOException
IOException
public com.google.common.base.Optional<PluginEntry> getEntry(String resourcePath) throws IOException
PluginContentScanner
getEntry
in interface PluginContentScanner
resourcePath
- full path of the resource inside the plugin packageIOException
- if there was a problem retrieving the resourcepublic Enumeration<PluginEntry> entries()
PluginContentScanner
entries
in interface PluginContentScanner
public InputStream getInputStream(PluginEntry entry) throws IOException
PluginContentScanner
getInputStream
in interface PluginContentScanner
entry
- resource entry inside the plugin packageIOException
- if there was an I/O problem accessing the resourcepublic Manifest getManifest() throws IOException
PluginContentScanner
getManifest
in interface PluginContentScanner
IOException
- if an I/O problem occurred whilst accessing the Manifest