Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.plugin
Class PluginManager

java.lang.Object
  extended by cytoscape.plugin.PluginManager

public class PluginManager
extends Object

Author:
skillcoy

Method Summary
 void clearErrorList()
          Clears the loading error list.
 void delete()
          Takes all objects on the "to-delete" list and deletes them.
 void delete(DownloadableInfo Obj)
          Marks the given object for deletion the next time Cytoscape is restarted.
 DownloadableInfo download(DownloadableInfo Obj)
          Downloads given object to the temporary directory.
 DownloadableInfo download(DownloadableInfo Obj, TaskMonitor taskMonitor)
          Downloads given object to the temporary directory.
 List<DownloadableInfo> findUpdates(DownloadableInfo Info)
          Get list of plugins that would update the given plugin.
static URLClassLoader getClassLoader()
           
 List<DownloadableInfo> getDownloadables(PluginStatus Status)
          Get a list of downloadable objects by status.
 List<Throwable> getLoadingErrors()
          /** Returns list of loading exceptions.
 File getPluginManageDirectory()
           
static PluginManager getPluginManager()
          Get the PluginManager object.
static List<URL> getPluginURLs()
           
static List<String> getResourcePlugins()
           
 List<DownloadableInfo> inquire(String Url)
          Calls the given url, expects document describing plugins available for download
 void install()
          Sets all plugins on the "install" list to "current"
 void install(DownloadableInfo obj)
          Change the given downloadable object from "install" to "current" status
 void loadPlugin(DownloadableInfo i)
           
 void loadPlugin(PluginInfo p)
          Load a single plugin based on the PluginInfo object given
 void loadPlugins(List<String> p)
          Parses the plugin input strings and transforms them into the appropriate URLs or resource names.
static void setPluginManageDirectory(String loc)
           
 void update(DownloadableInfo Current, DownloadableInfo New)
          Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory
 void update(DownloadableInfo currentObj, DownloadableInfo newObj, TaskMonitor taskMonitor)
          Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory
static boolean usingWebstartManager()
          Returns true/false based on the System property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLoadingErrors

public List<Throwable> getLoadingErrors()
/** Returns list of loading exceptions.


clearErrorList

public void clearErrorList()
Clears the loading error list. Ideally this should be called after checking the list each time.


getClassLoader

public static URLClassLoader getClassLoader()
Returns:
URLClassLoader used to load plugins at startup.

getResourcePlugins

public static List<String> getResourcePlugins()
Returns:
Set of resource plugins from startup

getPluginURLs

public static List<URL> getPluginURLs()
Returns:
Set of plugin URL's from startup

usingWebstartManager

public static boolean usingWebstartManager()
Returns true/false based on the System property. This is what is checked to find out if install/delete/download methods are permitted.

Returns:
true if Cytoscape is in webstart

getPluginManager

public static PluginManager getPluginManager()
Get the PluginManager object.

Returns:
PluginManager

setPluginManageDirectory

public static void setPluginManageDirectory(String loc)
Parameters:
loc - Location of plugin download/install directory. If this method is not called the default is .cytoscape/[cytoscape version]/plugins

getPluginManageDirectory

public File getPluginManageDirectory()
Returns:
The current version directory under .cytoscape that includes the plugins/ directory. Ex. //.cytoscape/2.6/plugins

getDownloadables

public List<DownloadableInfo> getDownloadables(PluginStatus Status)
Get a list of downloadable objects by status. CURRENT: currently installed INSTALL: objects to be installed DELETE: objects to be deleted

Parameters:
Status -
Returns:

inquire

public List<DownloadableInfo> inquire(String Url)
                               throws IOException,
                                      org.jdom.JDOMException
Calls the given url, expects document describing plugins available for download

Parameters:
Url -
Returns:
List of PluginInfo objects
Throws:
IOException
org.jdom.JDOMException

install

public void install()
Sets all plugins on the "install" list to "current"


install

public void install(DownloadableInfo obj)
Change the given downloadable object from "install" to "current" status

Parameters:
obj -

delete

public void delete(DownloadableInfo Obj)
            throws WebstartException
Marks the given object for deletion the next time Cytoscape is restarted.

Parameters:
Obj -
Throws:
WebstartException

delete

public void delete()
            throws ManagerException
Takes all objects on the "to-delete" list and deletes them. This can only occur at start up.

Throws:
ManagerException - If all files fail to delete
WebstartException - If this method is called from a webstart instance

findUpdates

public List<DownloadableInfo> findUpdates(DownloadableInfo Info)
                                   throws IOException,
                                          org.jdom.JDOMException
Get list of plugins that would update the given plugin.

Parameters:
Info -
Returns:
List
Throws:
ManagerException
IOException
org.jdom.JDOMException

update

public void update(DownloadableInfo Current,
                   DownloadableInfo New)
            throws IOException,
                   ManagerException,
                   WebstartException
Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory

Parameters:
Current - DownloadableInfo object currently installed
New - DownloadableInfo object to install
Throws:
IOException - Fails to download the file.
ManagerException - If the objects don't match or the new one is not a newer version.
WebstartException

update

public void update(DownloadableInfo currentObj,
                   DownloadableInfo newObj,
                   TaskMonitor taskMonitor)
            throws IOException,
                   ManagerException,
                   WebstartException
Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory

Parameters:
Current - PluginInfo object currently installed
New - PluginInfo object to install
taskMonitor - TaskMonitor for downloads
Throws:
IOException - Fails to download the file.
ManagerException - If the plugins don't match or the new one is not a newer version.
WebstartException

download

public DownloadableInfo download(DownloadableInfo Obj)
                          throws IOException,
                                 ManagerException
Downloads given object to the temporary directory.

Parameters:
Obj - PluginInfo object to be downloaded
Returns:
File downloaded
Throws:
IOException
ManagerException

download

public DownloadableInfo download(DownloadableInfo Obj,
                                 TaskMonitor taskMonitor)
                          throws IOException,
                                 ManagerException
Downloads given object to the temporary directory. Uses a task monitor if available.

Parameters:
Obj - PluginInfo object to be downloaded
taskMonitor - TaskMonitor
tempDirectory - Download to a different temporary directory. Default is .cytoscape/plugins/[cytoscape version number]
Returns:
File downloaded
Throws:
IOException
ManagerException

loadPlugin

public void loadPlugin(DownloadableInfo i)
                throws MalformedURLException,
                       IOException,
                       ClassNotFoundException,
                       PluginException
Throws:
MalformedURLException
IOException
ClassNotFoundException
PluginException

loadPlugin

public void loadPlugin(PluginInfo p)
                throws ManagerException
Load a single plugin based on the PluginInfo object given

Parameters:
PluginInfo - The plugin to load
Throws:
ManagerException

loadPlugins

public void loadPlugins(List<String> p)
Parses the plugin input strings and transforms them into the appropriate URLs or resource names. The method first checks to see if the


www.cytoscape.org