public static void loadProperties() {
    if (BEAN_PROPERTIES == null) {
      System.out.println("[KnowledgeFlow] Loading properties and plugins...");
      /** Loads the configuration property file */
      //  static {
      // Allow a properties file in the current directory to override
      try {
        BEAN_PROPERTIES = Utils.readProperties(PROPERTY_FILE);
        java.util.Enumeration keys =
          (java.util.Enumeration)BEAN_PROPERTIES.propertyNames();
        if (!keys.hasMoreElements()) {
          throw new Exception( "Could not read a configuration file for the bean\n"
                               +"panel. An example file is included with the Weka distribution.\n"
                               +"This file should be named \"" + PROPERTY_FILE + "\" and\n"
                               +"should be placed either in your user home (which is set\n"
                               + "to \"" + System.getProperties().getProperty("user.home") + "\")\n"
                               + "or the directory that java was started from\n");
        }
      } catch (Exception ex) {
        JOptionPane.showMessageDialog(null,
                                      ex.getMessage(),
                                      "KnowledgeFlow",
                                      JOptionPane.ERROR_MESSAGE);
      }


      // try and load any plugin beans properties
      File pluginDir = new File(System.getProperty("user.home")
                                +File.separator+".knowledgeFlow"
                                +File.separator+"plugins");
      if (pluginDir.exists() && pluginDir.isDirectory()) {
        BEAN_PLUGINS_PROPERTIES = new ArrayList<Properties>();
        // How many sub-dirs are there?
        File[] contents = pluginDir.listFiles();
        for (int i = 0; i < contents.length; i++) {
          if (contents[i].isDirectory() && 
              contents[i].listFiles().length > 0) {
            try {      
              Properties tempP = new Properties();
              File propFile = new File(contents[i].getPath()
                                       + File.separator
                                       + "Beans.props");
              tempP.load(new FileInputStream(propFile));
              BEAN_PLUGINS_PROPERTIES.add(tempP);

              // Now try and add all jar files in this directory to the classpath
              File anyJars[] = contents[i].listFiles();
              for (int j = 0; j < anyJars.length; j++) {
                if (anyJars[j].getPath().endsWith(".jar")) {
                  System.out.println("[KnowledgeFlow] Plugins: adding "+anyJars[j].getPath()
                                     +" to classpath...");
                  ClassloaderUtil.addFile(anyJars[j].getPath());
                }
              }
            } catch (Exception ex) {
              // Don't make a fuss
              System.err.println("[KnowledgeFlow] Warning: Unable to load bean properties for plugin "
                                 +"directory: " + contents[i].getPath());
            }
          }
          //        BEAN_PLUGINS_PROPERTIES = new Properties();
          //        BEAN_PLUGINS_PROPERTIES.load(new FileInputStream(pluginDir));
        }
      } else {
        // make the plugin directory for the user
        pluginDir.mkdir();
      }
    }