Package jSimMacs.logic.handler

Examples of jSimMacs.logic.handler.DataHandler


   * @param project
   * @throws IOException
   */
  public void loadProjectAttributes(Project project) throws IOException {
    if (project.getType() == null) {
      DataHandler handler = createDataHandler(project);
      String path;
      if (project.getLocation() == ProjectLocation.LOCALE)
        path = workspaceDir + project.getPathName()
            + JSimConstants.PROJECTCONFFILE;
      else {
        RemoteProject rProject = (RemoteProject) project;
        path = rProject.getPath() + rProject.getPathName()
            + JSimConstants.PROJECTCONFFILE;
      }
      File projectFile = handler.readFile(path);

      if (!projectFile.exists()) {
        createProjectDefaultFile(project, projectFile);
        if (handler instanceof SSHDataHandler) {
          ((SSHDataHandler) handler).copyToServer(projectFile);
View Full Code Here


      throws IOException {
    GromacsPanel gPanel = (GromacsPanel) selectedComponent;
    Set<String> directories = gPanel.directoryEntries();
    if (directories == null)
      return;
    DataHandler handler = null;
    if (project.getLocation() == ProjectLocation.SSH)
      handler = ((RemoteProject) project).getDataHandler();
    if (handler == null)
      handler = DataHandlerFactory.getDataHandler(project);

    for (String string : directories) {
      String[] dirs;
      boolean local = true;
      if(File.separator.equals("/")){
        dirs = string.split(File.separator);
      }
      else if (project.getLocation() == ProjectLocation.LOCALE)
        dirs = string.split(File.separator + File.separator);
      else{
        dirs = string.split("/");
        local = false;
      }
      String dirTmp = "";
      for (int i = 0; i < dirs.length; i++) {
        dirTmp += dirs[i];
        handler.createDirectory(project.getPathName() + dirTmp, false);
        if(local)
          dirTmp += File.separator;
        else
          dirTmp += "/";
      }
View Full Code Here

   * @param pathString
   * @param project
   */
  public void deleteBackupFiles(String pathString, Project project) {
    try {
      DataHandler handler = createDataHandler(project);
      handler.deleteBackup(pathString);
    } catch (IOException e) {
      JOptionPane.showMessageDialog(frame, e.getMessage(),
          "Delete error", JOptionPane.ERROR_MESSAGE);
      e.printStackTrace();
    }
View Full Code Here

   */
  public String createDirectory(String s, JSimMutuableTreeNode node)
      throws IOException {
    String fileDirectory = node.getPathString();

    DataHandler handler = createDataHandler(node.getProject());
    fileDirectory = handler.getParentDirectory(fileDirectory);

    if (fileDirectory.length() == 0)
      fileDirectory = globalOptions.getProperty(JSimConstants.WORKSPACE);
    if (!fileDirectory.endsWith("/")) {
      fileDirectory += "/";
    }

    fileDirectory += s;
    if (!handler.createDirectory(fileDirectory, true))
      return null;
    return fileDirectory;

  }
View Full Code Here

TOP

Related Classes of jSimMacs.logic.handler.DataHandler

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.