public class PluginInstaller
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PluginInstaller.NameAndVersion |
Modifier and Type | Field and Description |
---|---|
static int |
BAD |
static int |
LOADED |
static int |
NEWER_VERSION_INSTALLED |
static int |
NO_VERSIONS_INSTALLED |
static int |
NOT_LOADED |
static int |
OLDER_VERSION_INSTALLED |
static java.lang.String |
PLUGIN_XML_FILE |
static int |
SAME_VERSION_INSTALLED |
static int |
SUCCESS |
static int |
UNABLE_TO_COPY_FILE |
static int |
UNABLE_TO_CREATE_DIR |
static int |
UNCONVENTIONAL_FILENAME |
static int |
UNKNOWN_VERSION |
Constructor and Description |
---|
PluginInstaller() |
Modifier and Type | Method and Description |
---|---|
static int |
checkInstalledVersion(java.io.File f)
Check the status of the named plugin - whether an older, the same or a
newer version is already installed.
|
static int |
copyPlugin(javax.swing.JFrame frame,
java.io.File source,
java.lang.String destFileName) |
static int |
copyPlugin(javax.swing.JFrame frame,
java.net.URL source,
java.lang.String destFileName)
Copy a plugin to the user plugin directory.
|
static boolean |
deleteOlderVersions(java.io.File f) |
static boolean |
deletePlugin(PluginInstaller.NameAndVersion plugin)
Delete the given plugin.
|
static boolean |
deletePluginFile(java.io.File f)
This method deletes a plugin file.
|
static void |
deletePluginsOnStartup(java.lang.String[] filenames)
Delete the given files.
|
static <any> |
findInstalledPlugins()
Build a list of installed plugins.
|
static java.util.Map<net.sf.jabref.plugin.PluginInstaller.VersionNumber,java.io.File> |
getInstalledVersions(java.lang.String pluginName)
Based on a plugin name, find all versions that are already present
in the user plugin directory.
|
static java.lang.String[] |
getNameAndVersion(java.io.File f)
Look inside a jar file, find the plugin.xml file, and use it to determine the name
and version of the plugin.
|
static void |
installPlugin(JabRefFrame frame,
java.io.File file,
java.lang.String targetFileName) |
static void |
schedulePluginForDeletion(java.lang.String filename)
Add the given filename to the list of plugins to be deleted on the next
JabRef startup.
|
static java.io.File |
unpackPluginXML(java.io.File f)
Take the name of a jar file and extract the plugin.xml file, if possible,
to a temporary file.
|
public static final java.lang.String PLUGIN_XML_FILE
public static final int SUCCESS
public static final int UNABLE_TO_CREATE_DIR
public static final int UNABLE_TO_COPY_FILE
public static final int NO_VERSIONS_INSTALLED
public static final int NEWER_VERSION_INSTALLED
public static final int SAME_VERSION_INSTALLED
public static final int OLDER_VERSION_INSTALLED
public static final int UNCONVENTIONAL_FILENAME
public static final int UNKNOWN_VERSION
public static final int NOT_LOADED
public static final int LOADED
public static final int BAD
public static void installPlugin(JabRefFrame frame, java.io.File file, java.lang.String targetFileName)
public static int checkInstalledVersion(java.io.File f)
f
- The plugin file.public static boolean deletePlugin(PluginInstaller.NameAndVersion plugin)
plugin
- Name and version information for the plugin to delete.public static boolean deleteOlderVersions(java.io.File f)
public static boolean deletePluginFile(java.io.File f)
f
- The file to delete.public static int copyPlugin(javax.swing.JFrame frame, java.net.URL source, java.lang.String destFileName)
source
- The local or remote location to copy the plugin from.public static int copyPlugin(javax.swing.JFrame frame, java.io.File source, java.lang.String destFileName)
public static java.util.Map<net.sf.jabref.plugin.PluginInstaller.VersionNumber,java.io.File> getInstalledVersions(java.lang.String pluginName)
pluginName
- The name of the plugin.public static void schedulePluginForDeletion(java.lang.String filename)
filename
- The path to the file to delete.public static void deletePluginsOnStartup(java.lang.String[] filenames)
filenames
- An array of names of the files to be deleted.public static java.lang.String[] getNameAndVersion(java.io.File f)
f
- The file to investigate.public static java.io.File unpackPluginXML(java.io.File f)
f
- The jar file to extract from.public static <any> findInstalledPlugins()