public interface ServerPluginProvider
Allows to load one plugin from one external file or one directory by declaring the ability to handle it.
In order to load multiple files into a single plugin, group them into a directory tree and then load the directory root as a single plugin.
Modifier and Type | Interface and Description |
---|---|
static class |
ServerPluginProvider.PluginDescription
Descriptor of the Plugin that ServerPluginProvider has to load.
|
Modifier and Type | Method and Description |
---|---|
ServerPlugin |
get(Path srcPath,
org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot,
ServerPluginProvider.PluginDescription pluginDescriptor)
Loads an external file or directory into a Server plugin.
|
String |
getPluginName(Path srcPath)
Returns the plugin name of an external file or directory
|
String |
getProviderPluginName()
Returns the plugin name of this provider.
|
boolean |
handles(Path srcPath)
Declares the availability to manage an external file or directory
|
boolean handles(Path srcPath)
srcPath
- the external file or directoryString getPluginName(Path srcPath)
Should be called only if handles(srcFile)
returns true and thus
srcFile is a supported plugin format. An IllegalArgumentException is thrown otherwise as
srcFile is not a valid file format for extracting its plugin name.
srcPath
- external file or directoryServerPlugin get(Path srcPath, org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot, ServerPluginProvider.PluginDescription pluginDescriptor) throws InvalidPluginException
Should be called only if handles(srcFile)
returns true and thus
srcFile is a supported plugin format. An IllegalArgumentException is thrown otherwise as
srcFile is not a valid file format for extracting its plugin name.
srcPath
- external file or directorysnapshot
- snapshot of the external filepluginDescriptor
- descriptor of the ServerPlugin to loadInvalidPluginException
- if plugin is supposed to be handled but cannot be loaded for any
other reasonString getProviderPluginName()
Allows to identify which plugin provided the current ServerPluginProvider by returning the plugin name. Helpful for troubleshooting plugin loading problems.