public class JarPluginProvider extends java.lang.Object implements ServerPluginProvider
ServerPluginProvider.PluginDescription
Modifier and Type | Method and Description |
---|---|
ServerPlugin |
get(java.io.File srcFile,
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.io.File srcFile) |
java.lang.String |
getPluginName(java.io.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. |
java.lang.String |
getProviderPluginName()
Returns the plugin name of this provider.
|
boolean |
handles(java.io.File srcFile)
Declares the availability to manage an external file or directory
|
static java.io.File |
storeInTemp(java.lang.String pluginName,
java.io.InputStream in,
SitePaths sitePaths) |
public boolean handles(java.io.File srcFile)
ServerPluginProvider
handles
in interface ServerPluginProvider
srcFile
- the external file or directorypublic java.lang.String getPluginName(java.io.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 java.lang.String getJarPluginName(java.io.File srcFile) throws java.io.IOException
java.io.IOException
public ServerPlugin get(java.io.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 java.lang.String getProviderPluginName()
ServerPluginProvider
getProviderPluginName
in interface ServerPluginProvider
public static java.io.File storeInTemp(java.lang.String pluginName, java.io.InputStream in, SitePaths sitePaths) throws java.io.IOException
java.io.IOException