Changeset 3136

Show
Ignore:
Timestamp:
03/02/10 18:46:42 (5 months ago)
Author:
martijn
Message:

Avoid unnecessary exception when looking for plugins, patch by Mark (#1105)

Location:
trunk/src/swing/org/pathvisio
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/swing/org/pathvisio/gui/swing/GuiMain.java

    r3080 r3136  
    409409 
    410410                // load plugins from the default plugin dir 
    411                 pluginLocations.add("" + new File (GlobalPreference.getApplicationDir(), "plugins")); 
     411                File pluginDir = new File (GlobalPreference.getApplicationDir(), "plugins"); 
     412                if (pluginDir.exists()) { 
     413                        pluginLocations.add("" + pluginDir); 
     414                } 
    412415                processOptions(); 
    413416        } 
  • trunk/src/swing/org/pathvisio/plugin/PluginManager.java

    r2979 r3136  
    109109                                return; 
    110110                        } 
     111                        // see if it is a jar file. 
    111112                        if(file.getName().endsWith(".jar")) 
    112113                        { 
     
    116117                        } 
    117118                } 
    118                 //Otherwise, try to load the class directly 
     119                //It's not a directory or a jar file.  
     120                //Try to load the class directly 
    119121                Logger.log.info("No jar or dir found, assuming plugin argument is a class " + param); 
    120122                PluginInfo inf = new PluginInfo(); 
     
    206208                        } 
    207209                } catch(Throwable ex) { 
    208                         Logger.log.error("\tUnable to load plugin", ex); 
     210                        Logger.log.error("\tUnable to load plugin '" + className + "'", ex); 
    209211                        inf.error = ex; 
    210212                        info.add(inf);