Package org.parosproxy.paros.model

Examples of org.parosproxy.paros.model.Session


        return;
      }
      model.createAndOpenUntitledDb();
    }

    Session session = new Session(model);
    log.info("new session file created");
    model.setSession(session);

    view.getSiteTreePanel().getTreeSite().setModel(session.getSiteTree());

    control.getExtensionLoader().sessionChangedAllPlugin(session);
    // refresh display

    view.getMainFrame().setTitle(session.getSessionName() + " - " + Constant.PROGRAM_NAME + " " + Constant.PROGRAM_VERSION);
    view.getOutputPanel().clear();

  }
View Full Code Here


        file = chooser.getSelectedFile();
        if (file == null) {
          return;
        }
        model.getOptionsParam().setUserDirectory(chooser.getCurrentDirectory());
        Session session = model.getSession();
        log.info("opening session file " + file.getAbsolutePath());
        waitMessageDialog = view.getWaitMessageDialog("Loading session file. Please wait ...");
        session.open(file, this);
        waitMessageDialog.setVisible(true);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

      }
    }
  }

  public void saveSession() {
    Session session = model.getSession();

    if (session.isNewState()) {
      view.showWarningDialog("Please use \"Save As...\"");
      return;
    }

    try {
      waitMessageDialog = view.getWaitMessageDialog("Saving session file.  Please wait ...");
      session.save(session.getFileName(), this);
      log.info("saving session file " + session.getFileName());
      // ZAP: If the save is quick the dialog can already be null here
          if (waitMessageDialog != null) {
            waitMessageDialog.setVisible(true);
          }

    } catch (Exception e) {
      view.showWarningDialog("Error saving session file.");
      log.error("error saving session file " + session.getFileName());
      log.error(e.getMessage());

    }

  }
View Full Code Here

    }

  }

  public void saveAsSession() {
    Session session = model.getSession();

    JFileChooser chooser = new JFileChooser(model.getOptionsParam().getUserDirectory());
    chooser.setFileFilter(new FileFilter() {
      public boolean accept(File file) {
        if (file.isDirectory()) {
          return true;
        } else if (file.isFile() && file.getName().endsWith(".session")) {
          return true;
        }
        return false;
      }

      public String getDescription() {
        return "Andiparos session";
      }
    });
    File file = null;
    int rc = chooser.showSaveDialog(view.getMainFrame());
    if (rc == JFileChooser.APPROVE_OPTION) {
      file = chooser.getSelectedFile();
      if (file == null) {
        return;
      }
      model.getOptionsParam().setUserDirectory(chooser.getCurrentDirectory());
      String fileName = file.getAbsolutePath();
      if (!fileName.endsWith(".session")) {
        fileName += ".session";
      }

      try {
        waitMessageDialog = view.getWaitMessageDialog("Saving new session file.  Please wait ...");
        session.save(fileName, this);
        log.info("save as session file " + session.getFileName());
        waitMessageDialog.setVisible(true);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

    control = new Control(Model.getSingleton(), null);
  }

  public void runCommandLineNewSession(String fileName) throws Exception {

    Session session = new Session(model);
    log.info("new session file created");
    model.setSession(session);
    control.getExtensionLoader().sessionChangedAllPlugin(session);

    if (!fileName.endsWith(".session")) {
      fileName += ".session";
    }
    session.save(fileName);
    getExtensionLoader().runCommandLine();
  }
View Full Code Here

    session.save(fileName);
    getExtensionLoader().runCommandLine();
  }

  public void runCommandLineOpenSession(String fileName) {
    Session session = new Session(model);
    log.info("new session file created");
    model.setSession(session);
    control.getExtensionLoader().sessionChangedAllPlugin(session);
  }
View Full Code Here

    SiteNode node = ref.getSiteNode();
    if (node == null) {
      return;
    }

    Session session = Model.getSingleton().getSession();
    SiteMap map = session.getSiteTree();

    if (node.getHistoryReference() == ref) {
      // same active Node
      PopupPurgeMenu.purge(map, node);
    } else {
View Full Code Here

    return historyList;
  }

  public String search(String filter, boolean isRequest) {
    String result = "";
    Session session = getModel().getSession();
    Pattern pattern = Pattern.compile(filter, Pattern.MULTILINE
        | Pattern.CASE_INSENSITIVE);
    Matcher matcher = null;

    getHistoryList();
    synchronized (historyList) {
      try {
        List<Integer> list = getModel().getDb().getTableHistory().getHistoryList(session.getSessionId(),HistoryReference.TYPE_MANUAL, filter, isRequest);
        int last = list.size();
        for (int index = 0; index < last; index++) {
          int v = ((Integer) (list.get(index))).intValue();
          try {
            HttpMessage message = getModel().getDb().getTableHistory().read(v).getHttpMessage();
View Full Code Here

    SiteNode node = ref.getSiteNode();
    if (node == null) {
      return;
    }

    Session session = Model.getSingleton().getSession();
    SiteMap map = session.getSiteTree();

    if (node.getHistoryReference() == ref) {
      // same active Node
      PopupDeleteMenu.delete(map, node);
    } else {
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.model.Session

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.