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)
ServerPluginProvider
handles
in interface ServerPluginProvider
srcPath
- the external file or directorypublic String getPluginName(Path srcPath)
ServerPluginProvider
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 ServerPluginProvider
srcPath
- external file or directorypublic static String getJarPluginName(Path srcPath) throws IOException
IOException
public ServerPlugin get(Path srcPath, org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot, ServerPluginProvider.PluginDescription description) throws InvalidPluginException
ServerPluginProvider
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 ServerPluginProvider
srcPath
- 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()
ServerPluginProvider
getProviderPluginName
in interface ServerPluginProvider
public static Path storeInTemp(String pluginName, InputStream in, SitePaths sitePaths) throws IOException
IOException