public class JarPluginProvider extends Object implements ServerPluginProvider
ServerPluginProvider.PluginDescription| Modifier and Type | Method and Description |
|---|---|
ServerPlugin |
get(Path srcPath,
org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot,
ServerPluginProvider.PluginDescription description)
Loads an external file or directory into a Server plugin.
|
static String |
getJarPluginName(Path srcPath) |
String |
getPluginName(Path srcPath)
Returns the plugin name of an external file or directory
Should be called only if
handles(srcFile)
returns true and thus srcFile is a supported plugin format. |
String |
getProviderPluginName()
Returns the plugin name of this provider.
|
boolean |
handles(Path srcPath)
Declares the availability to manage an external file or directory
|
static Path |
storeInTemp(String pluginName,
InputStream in,
SitePaths sitePaths) |
public boolean handles(Path srcPath)
ServerPluginProviderhandles in interface ServerPluginProvidersrcPath - the external file or directorypublic String getPluginName(Path srcPath)
ServerPluginProviderhandles(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 String getJarPluginName(Path srcPath) throws IOException
IOExceptionpublic ServerPlugin get(Path srcPath, org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot, ServerPluginProvider.PluginDescription description) throws InvalidPluginException
ServerPluginProviderhandles(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 String getProviderPluginName()
ServerPluginProvidergetProviderPluginName in interface ServerPluginProviderpublic static Path storeInTemp(String pluginName, InputStream in, SitePaths sitePaths) throws IOException
IOException