JOptionPane.showMessageDialog(this, "Cannot save results.  Unable to access " + " filesystem for " + hostName + " : " + remotePort + ".", "Unable to access file system", JOptionPane.WARNING_MESSAGE); continue;
JOptionPane.showMessageDialog(this, "Cannot save results.  Unable to access filesystem for " + ni.hostName + ".", "Unable to access file system", JOptionPane.WARNING_MESSAGE); continue;
  private void saveResults() {    if (currentTrial < 0)      return; // nothing to save    File resultDir = experiment.getResultDirectory();    if (resultDir == null)      return; // can't save, user didn't specify metrics directory    Trial trial = experiment.getTrials()[currentTrial];    if (runStart == null)      runStart = new Date();    String dirname = resultDir.getAbsolutePath() + File.separatorChar +       experiment.getExperimentName() + File.separatorChar +      trial.getShortName() + File.separatorChar +      "Results-" + fileDateFormat.format(runStart);    try {      File f = new File(dirname);      // guarantee that directories exist      if (!f.exists() && !f.mkdirs() && !f.exists()) {        if(log.isErrorEnabled()) {          log.error("CSMARTConsole: Could not save results in: " +			   dirname);        }	return;      }      String myHostName = InetAddress.getLocalHost().getHostName();      URL url = new URL("file", myHostName, dirname);      trial.addTrialResult(new TrialResult(runStart, url));    } catch (Exception e) {      if(log.isErrorEnabled()) {        log.error("Exception creating trial results URL: ", e);      }    }    HostComponent[] hosts = experiment.getHostComponents();    for (int i = 0; i < hosts.length; i++) {      NodeComponent[] nodes = hosts[i].getNodes();      // Skip hosts that have no node      if (nodes.length == 0)        continue;      String hostName = hosts[i].getShortName();      // get host port from first node on this host      // TODO: note that if the user specified different server ports for      // different nodes on the same host, this won't work      Properties properties = null;      properties = getNodeMinusD(nodes[0], hostName);      int remotePort = getAppServerPort(properties);      RemoteHost remoteAppServer;      try {	remoteAppServer =           remoteHostRegistry.lookupRemoteHost(              hostName, remotePort, true);      } catch (java.rmi.UnknownHostException uhe) {	JOptionPane.showMessageDialog(this,				      "Unknown host: " + hostName,				      "Unknown Host",				      JOptionPane.WARNING_MESSAGE);	continue;      } catch (Exception e) {	// This happens if you listed random hosts which you don't	// really intend to talk to	JOptionPane.showMessageDialog(this,				      "Cannot save results.  No response from: " +                                       hostName + " : " + remotePort +				      "; check that server is running.",				      "No Response From Server",				      JOptionPane.WARNING_MESSAGE);	continue;      }      RemoteFileSystem remoteFS;      try {        remoteFS = remoteAppServer.getRemoteFileSystem();      } catch (Exception e) {	JOptionPane.showMessageDialog(this,				      "Cannot save results.  Unable to access " +                                      " filesystem for " +                                       hostName + " : " + remotePort +				      ".",				      "Unable to access file system",				      JOptionPane.WARNING_MESSAGE);	continue;      }      copyResultFiles(remoteFS, dirname);    }  }