Package jSimMacs.logic.handler

Examples of jSimMacs.logic.handler.SSHDataHandler


   * Saves Project Settings (XML)
   * @param project
   */
  public void saveProjectSettings(Project project) {
    String projectFile = "";
    SSHDataHandler handler = null;
    if (project.getLocation() == ProjectLocation.LOCALE) {
      projectFile = workspaceDir + project.getPathName()
          + JSimConstants.PROJECTCONFFILE;
    } else {
      RemoteProject rmProject = (RemoteProject) project;
      handler = (SSHDataHandler) rmProject.getDataHandler();
      projectFile = handler
          .createTempPath(rmProject.getPath() + rmProject.getName()
              + "/" + JSimConstants.PROJECTCONFFILE);
      projectFile += JSimConstants.PROJECTCONFFILE;
    }
    IXMLWriter projectWriter = new ProjectSettingSAXWriter(project);
    try {
      projectWriter.writeXML(projectFile);
    } catch (Exception e) {
      JOptionPane.showMessageDialog(frame, e.getMessage(), "Save error",
          JOptionPane.ERROR_MESSAGE);
      e.printStackTrace();
    }
    if (project.getLocation() == ProjectLocation.SSH) {
      try {
        handler.copyToServer(new File(projectFile));
      } catch (IOException e) {
        JOptionPane.showMessageDialog(frame, e.getMessage(),
            "Save error", JOptionPane.ERROR_MESSAGE);
        e.printStackTrace();
      }
View Full Code Here

TOP

Related Classes of jSimMacs.logic.handler.SSHDataHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.