public class JarPluginProvider extends Object implements ServerPluginProvider
ServerPluginProvider.PluginDescription
Modifier and Type | Method and Description |
---|---|
ServerPlugin |
get(File srcFile,
org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot,
ServerPluginProvider.PluginDescription description)
Loads an external file or directory into a Server plugin.
|
static String |
getJarPluginName(File srcFile) |
String |
getPluginName(File srcFile)
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(File srcFile)
Declares the availability to manage an external file or directory
|
static File |
storeInTemp(String pluginName,
InputStream in,
SitePaths sitePaths) |
public boolean handles(File srcFile)
ServerPluginProvider
handles
in interface ServerPluginProvider
srcFile
- the external file or directorypublic String getPluginName(File srcFile)
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
srcFile
- external file or directorypublic static String getJarPluginName(File srcFile) throws IOException
IOException
public ServerPlugin get(File srcFile, 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
srcFile
- 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 File storeInTemp(String pluginName, InputStream in, SitePaths sitePaths) throws IOException
IOException