public class JarPluginProvider extends java.lang.Object implements ServerPluginProvider
ServerPluginProvider.PluginDescription| Modifier and Type | Method and Description |
|---|---|
ServerPlugin |
get(java.nio.file.Path srcPath,
org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot,
ServerPluginProvider.PluginDescription description)
Loads an external file or directory into a Server plugin.
|
static java.lang.String |
getJarPluginName(java.nio.file.Path srcPath) |
java.lang.String |
getPluginName(java.nio.file.Path srcPath)
Returns the plugin name of an external file or directory
|
java.lang.String |
getProviderPluginName()
Returns the plugin name of this provider.
|
boolean |
handles(java.nio.file.Path srcPath)
Declares the availability to manage an external file or directory
|
static java.nio.file.Path |
storeInTemp(java.lang.String pluginName,
java.io.InputStream in,
SitePaths sitePaths) |
public boolean handles(java.nio.file.Path srcPath)
ServerPluginProviderhandles in interface ServerPluginProvidersrcPath - the external file or directorypublic java.lang.String getPluginName(java.nio.file.Path srcPath)
ServerPluginProviderShould 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.
getPluginName in interface ServerPluginProvidersrcPath - external file or directorypublic static java.lang.String getJarPluginName(java.nio.file.Path srcPath)
throws java.io.IOException
java.io.IOExceptionpublic ServerPlugin get(java.nio.file.Path srcPath, org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot, ServerPluginProvider.PluginDescription description) throws InvalidPluginException
ServerPluginProviderShould 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.
get in interface ServerPluginProvidersrcPath - external file or directorysnapshot - snapshot of the external filedescription - descriptor of the ServerPlugin to loadInvalidPluginException - if plugin is supposed to be handled but cannot be loaded for any
other reasonpublic java.lang.String getProviderPluginName()
ServerPluginProviderAllows to identify which plugin provided the current ServerPluginProvider by returning the plugin name. Helpful for troubleshooting plugin loading problems.
getProviderPluginName in interface ServerPluginProviderpublic static java.nio.file.Path storeInTemp(java.lang.String pluginName,
java.io.InputStream in,
SitePaths sitePaths)
throws java.io.IOException
java.io.IOException