Package com.google.gerrit.server.plugins
Interface PluginContentScanner
- 
- All Known Implementing Classes:
- AbstractPreloadedPluginScanner,- JarScanner
 
 public interface PluginContentScannerScans 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 Classes Modifier and Type Interface Description static classPluginContentScanner.ExtensionMetaDataPlugin class extension meta-data
 - 
Field SummaryFields Modifier and Type Field Description static PluginContentScannerEMPTYScanner without resources.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Stream<PluginEntry>entries()Return all the resources inside a pluginOptional<PluginEntry>getEntry(String resourcePath)Return the plugin resource associated to a pathInputStreamgetInputStream(PluginEntry entry)Return the InputStream of the resource entryManifestgetManifest()Return 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 Detail- 
EMPTYstatic final PluginContentScanner EMPTY Scanner without resources.
 
- 
 - 
Method Detail- 
getManifestManifest getManifest() throws IOException Return 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
 
 - 
getEntryOptional<PluginEntry> getEntry(String resourcePath) throws IOException Return 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
 
 - 
getInputStreamInputStream getInputStream(PluginEntry entry) throws IOException Return 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
 
 
- 
 
-