sc = helper.createSociety(file.getName(), name, SocietyFileComponent.class);
sc = helper.createSociety(file.getPath(), name, SocietyFileComponent.class);
  private SocietyComponent newSocietyComponent() {    // display file chooser to allow user to select file that defines society    JFileChooser chooser =       new JFileChooser(SocietyFinder.getInstance().getPath());    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);    File file = null;    SocietyComponent sc = null;    while (file == null) {      int result = chooser.showDialog(this, "OK");      if (result != JFileChooser.APPROVE_OPTION)	return null;      file = chooser.getSelectedFile();    }    // The file they select needs to be on the config path    // or else you get an exception!    // Can we fix that by perhaps in SocietyFinder passing    // in the full path to the file?    // FIXME!!!    // create society from agent files or single node file    String name = "";    name = file.getName();    if (name.endsWith(".ini"))      name = name.substring(0, name.length()-4);        // if name is not unique, then get an unique name for the society    while (societyNames.contains(name)) {      name = societyNames.generateName(name);      name = 	(String)JOptionPane.showInputDialog(this, "Enter Society Name",					    "Society Name Not Unique",					    JOptionPane.QUESTION_MESSAGE,					    null, null, name);    }    if (name == null) return null;     if (file.isDirectory()) {      // If I added this directory to the org.cougaar.config.path      // and if I could force a recalc of the static      // default config finder, or have other users      // recreate the configfinder - do a new, then I'd be OK.//       String occp = System.getProperty("org.cougaar.config.path");//       log.debug("occp is: " + occp);//       if (occp.endsWith("\\;")) {// 	  System.setProperty("org.cougaar.config.path", occp + file.getPath() + "\\;");//       } else {// 	  System.setProperty("org.cougaar.config.path", occp + file.getPath() + ";");//       }//       log.debug("After mucking occp is: " + System.getProperty("org.cougaar.config.path"));      String[] filenames =        SocietyFinder.getInstance().getAgentFilenames(file);      if (filenames == null || filenames.length == 0) {	// Found no Agents	if (log.isWarnEnabled()) {	  log.warn("Found no agent in dir " + file.getPath());	}	return null;      }      sc = helper.createSociety(name, filenames, SocietyFileComponent.class);    } else {      sc = helper.createSociety(file.getName(), name, SocietyFileComponent.class);    }    if (sc == null)      return null;    societyNames.add(name);    sc.setName(name);     return sc;  }