Package org.parosproxy.paros.network

Examples of org.parosproxy.paros.network.HttpMessage


      menuItemSpider.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent e) {
            JTree siteTree = getView().getSiteTreePanel().getTreeSite();
                SiteNode node = (SiteNode) siteTree.getLastSelectedPathComponent();
                HttpMessage msg = null;
                if (node == null) {
                    getView().showWarningDialog("You need to visit the website via a browser first and select a URL/folder/node in the 'Sites' panel displayed.");
                    return;
                }
                  setStartNode(node);
                  if (node.isRoot()) {
                      showDialog("All sites will be crawled");
                  } else {
                        try {
                            msg = node.getHistoryReference().getHttpMessage();
                        } catch (Exception e1) {
                            return;
                        }
                        String tmp = msg.getRequestHeader().getURI().toString();
                        showDialog(tmp);
                  }
                 
                 
        }
View Full Code Here


 
  private void inOrderSeed(Spider spider, SiteNode node) {

      try {
          if (!node.isRoot()) {
              HttpMessage msg = node.getHistoryReference().getHttpMessage();
              if (msg != null) {
                  if (!msg.getResponseHeader().isImage()) {
                      spider.addSeed(msg);
                  }
              }
          }
      } catch (Exception e) {
View Full Code Here

  public void readURI(HttpMessage msg) {

      SiteMap siteTree = getModel().getSession().getSiteTree();

      // record into sitemap if not exist
    HttpMessage existing = siteTree.pollPath(msg);

//    always add to tree   
//    if (existing != null) {
//        return;
//    }
View Full Code Here

                    extension.getView().showWarningDialog("Only one response can be exported at a time.");                  
                    return;
                }

                HistoryReference ref = (HistoryReference) obj[0];
                HttpMessage msg = null;
                try {
                    msg = ref.getHttpMessage();
                } catch (Exception e1) {
                    extension.getView().showWarningDialog("Error reading response.");
                    return;
                }
               
                if (msg.getResponseHeader().isEmpty() || msg.getResponseBody().length() == 0) {
                    extension.getView().showWarningDialog("Empty body.  File not created.");
                    return;                   
                }
                   
              File file = getOutputFile(msg);
View Full Code Here

                extension.setStartNode(node);
                  if (node.isRoot()) {
                      extension.showDialog("All sites will be crawled");
                  } else {
                      try {
                          HttpMessage msg = node.getHistoryReference().getHttpMessage();
                          if (msg != null) {
                              String tmp = msg.getRequestHeader().getURI().toString();
                              extension.showDialog(tmp);
                          }
                      } catch (Exception e1) {
                         
                      }
View Full Code Here

        menuManualRequestEditor.setText("Manual Request Editor...");
        menuManualRequestEditor.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent e) {
              ManualRequestEditorDialog dialog = getManualRequestEditorDialog();
              if (dialog.getRequestPanel().getTxtHeader().getText().equals("")) {
                  HttpMessage msg = new HttpMessage();
                  try {
                      URI uri = new URI("http://www.any_domain_name.org/path", true);
                            msg.setRequestHeader(new HttpRequestHeader(HttpRequestHeader.GET, uri, HttpHeader.HTTP10));
                            dialog.getRequestPanel().setMessage(msg, true);
                        } catch (Exception e1) {}
                       
              }
              dialog.setVisible(true);
View Full Code Here

      extension.setStartNode(node);
        if (node.isRoot()) {
            getTxtDisplay().setText("All sites will be crawled");
        } else {
            try {
                HttpMessage msg = node.getHistoryReference().getHttpMessage();
                if (msg != null) {
                    String tmp = msg.getRequestHeader().getURI().toString();
                    getTxtDisplay().setText(tmp);
                    //getTxtDisplay().setCaretPosition(0);
                   
                }
            } catch (Exception e1) {
View Full Code Here

    public String getFileName() {
        return fileName;
    }
   
    private void saveSiteTree(SiteNode node) {
        HttpMessage msg = null;

        if (!node.isRoot()) {
            if (node.getHistoryReference().getHistoryType() < 0) {
                // -ve means to be saved
                saveNodeMsg(msg);
View Full Code Here

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
       
        HistoryReference ref = (HistoryReference) value;
        txtId.setText(Integer.toString(ref.getHistoryId()));
       
        HttpMessage msg;
        try {
            msg = ref.getHttpMessage();
            txtMethod.setText(msg.getRequestHeader().getMethod());
            txtURI.setText(msg.getRequestHeader().getURI().toString());
            txtStatus.setText(Integer.toString(msg.getResponseHeader().getStatusCode()));
            txtReason.setText(msg.getResponseHeader().getReasonPhrase());
            txtRTT.setText(msg.getTimeElapsedMillis()+"ms");
            txtTag.setText(msg.getTag());

        } catch (HttpMalformedHeaderException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
View Full Code Here

       
        if (newestVersionName == null) {
            return;
        }
       
        HttpMessage msg = new HttpMessage();
        try {
            msg.setRequestHeader(header);
            msg.setRequestBody(getBody(mirrorList[getRandom(mirrorList.length)], newestVersionName));
           
            getHttpSender().sendAndReceive(msg,true);
           
            if (msg.getResponseHeader().getStatusCode() != HttpStatusCode.OK) {
                throw new IOException();
            }

            if (silent && manualCheckStarted) {
                return;
            }
           
            File file = null;
            if (Constant.isWindows()) {
                file = new File("parosnew.exe");
            } else if (Constant.isLinux()) {
                file = new File("parosnew.zip");
            }
           
            FileOutputStream os = new FileOutputStream(file);
            os.write(msg.getResponseBody().getBytes());
            os.close();


            try {
                final File updateFile = file;
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.network.HttpMessage

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.