Package com.google.gerrit.server.plugins
Interface PluginContentScanner
- All Known Implementing Classes:
- AbstractPreloadedPluginScanner,- JarScanner
public interface PluginContentScanner
Scans the plugin returning classes and resources.
 
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.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classPlugin class extension meta-data
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionentries()Return all the resources inside a pluginReturn the plugin resource associated to a pathgetInputStream(PluginEntry entry) Return the InputStream of the resource entryReturn the plugin meta-data manifestMap<Class<? extends Annotation>, Iterable<PluginContentScanner.ExtensionMetaData>> scan(String pluginName, Iterable<Class<? extends Annotation>> annotations) Scans the plugin for declared public annotated classes
- 
Field Details- 
EMPTYScanner without resources.
 
- 
- 
Method Details- 
getManifestReturn the plugin meta-data manifest- Returns:
- Manifest of the plugin or null if plugin has no meta-data
- Throws:
- IOException- if an I/O problem occurred whilst accessing the Manifest
 
- 
scanMap<Class<? extends Annotation>,Iterable<PluginContentScanner.ExtensionMetaData>> scan(String pluginName, Iterable<Class<? extends Annotation>> annotations) throws InvalidPluginException Scans the plugin for declared public annotated classes- Parameters:
- pluginName- the plugin name
- annotations- annotations declared by the plugin classes
- Returns:
- map of annotations and associated plugin classes found
- Throws:
- InvalidPluginException- if the plugin is not valid or corrupted
 
- 
getEntryReturn the plugin resource associated to a path- Parameters:
- resourcePath- full path of the resource inside the plugin package
- Returns:
- the resource object or Optional.absent() if the resource was not found
- Throws:
- IOException- if there was a problem retrieving the resource
 
- 
getInputStreamReturn the InputStream of the resource entry- Parameters:
- entry- resource entry inside the plugin package
- Returns:
- the resource input stream
- Throws:
- IOException- if there was an I/O problem accessing the resource
 
- 
entriesStream<PluginEntry> entries()Return all the resources inside a plugin- Returns:
- the enumeration of all resources found
 
 
-