public interface PluginContentScanner
Gerrit uses the scanner to automatically discover the classes and resources exported by the plugin for auto discovery of exported SSH commands, Servlets and listeners.
| Modifier and Type | Interface and Description |
|---|---|
static class |
PluginContentScanner.ExtensionMetaData
Plugin class extension meta-data
|
| Modifier and Type | Field and Description |
|---|---|
static PluginContentScanner |
EMPTY
Scanner without resources.
|
| Modifier and Type | Method and Description |
|---|---|
Enumeration<PluginEntry> |
entries()
Return all the resources inside a plugin
|
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
|
static final PluginContentScanner EMPTY
Manifest getManifest() throws IOException
IOException - if an I/O problem occurred whilst accessing the ManifestMap<Class<? extends Annotation>,Iterable<PluginContentScanner.ExtensionMetaData>> scan(String pluginName, Iterable<Class<? extends Annotation>> annotations) throws InvalidPluginException
pluginName - the plugin nameannotations - annotations declared by the plugin classesInvalidPluginException - if the plugin is not valid or corruptedOptional<PluginEntry> getEntry(String resourcePath) throws IOException
resourcePath - full path of the resource inside the plugin packageIOException - if there was a problem retrieving the resourceInputStream getInputStream(PluginEntry entry) throws IOException
entry - resource entry inside the plugin packageIOException - if there was an I/O problem accessing the resourceEnumeration<PluginEntry> entries()