public void loadPlugins(File file) throws IOException, ClassNotFoundException {
  Object pluginObject, activeListObject;
  FileInputStream fis;
  ObjectInputStream ois;
  fis=new FileInputStream(file);
  ois=new ObjectInputStream(fis);
  pluginObject=ois.readObject();
  activeListObject=ois.readObject();
  ois.close();
  if (!(pluginObject instanceof PluginContainer)) {
    LOG.error("Incompatible Filetype. Could not read plugin configuration.");
    return;
  }
  PluginContainer collection=(PluginContainer)pluginObject;
  for (  AbstractPlugin savedPlugin : collection) {
    AbstractPlugin currentPlugin=allPlugins.getByName(savedPlugin.getName());
    if (currentPlugin != null) {
      currentPlugin.restoreConfiguration(savedPlugin);
    }
 else {
      LOG.warn("Could not restore Plugin-Configuration for Plugin '" + savedPlugin.getName() + "' - Plugin not available!");
    }
  }
  if (!(activeListObject instanceof List)) {
    LOG.error("Incompatible Filetype. Could not read active plugin list.");
    return;
  }
  @SuppressWarnings("rawtypes") List activeList=(List)activeListObject;
  for (  Object active : activeList) {
    if (active instanceof String) {
      setActive(getByName((String)active),true);
    }
  }
}

public void loadPlugins ( File file ) throws IOException , ClassNotFoundException { Object pluginObject , activeListObject ; FileInputStream fis ; ObjectInputStream ois ; fis = new FileInputStream ( file ) ; ois = new ObjectInputStream ( fis ) ; pluginObject = ois . readObject ( ) ; activeListObject = ois . readObject ( ) ; ois . close ( ) ; if ( ! ( pluginObject instanceof PluginContainer ) ) { LOG . error ( "Incompatible Filetype. Could not read plugin configuration." ) ; return ; } PluginContainer collection = ( PluginContainer ) pluginObject ; for ( AbstractPlugin savedPlugin : collection ) { AbstractPlugin currentPlugin = allPlugins . getByName ( savedPlugin . getName ( ) ) ; if ( currentPlugin != null ) { currentPlugin . restoreConfiguration ( savedPlugin ) ; } else { LOG . warn ( "Could not restore Plugin-Configuration for Plugin '" + savedPlugin . getName ( ) + "' - Plugin not available!" ) ; } } if ( ! ( activeListObject instanceof List ) ) { LOG . error ( "Incompatible Filetype. Could not read active plugin list." ) ; return ; } @ SuppressWarnings ( "rawtypes" ) List activeList = ( List ) activeListObject ; for ( Object active : activeList ) { if ( active instanceof String ) { setActive ( getByName ( ( String ) active ) , true ) ; } } }
* loads a plugin configuration from a file
