Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.URI$CharsetChanged


     *
     */
    private boolean isNeglectFound(HttpMessage msg) throws URIException {
        boolean result = false;

        URI uri = msg.getRequestHeader().getURI();
       
        // check correct protocol
        if (!uri.getScheme().equalsIgnoreCase("HTTP") && !uri.getScheme().equalsIgnoreCase("HTTPS")) {
            return true;
        }

        // compare if in seed's domain or inside session domain scope
        String hostName = uri.getHost().toUpperCase();
        if (!isSeedScope(uri)) {
            if (!getSpiderParam().isInScope(hostName)) {
                return true;
            }
        }
View Full Code Here


  protected void buildAttrs(String attrs) {
    super.buildAttrs(attrs);

    String tmp = parserAttrHref.getValue(attrs);
        try {
            URI uri = new URI(tmp, false);
            if (uri.isAbsoluteURI()) {
                href = tmp;
            }
        } catch (Exception e) {
        }
       
View Full Code Here

    String locationHeader = null;
    String locationHeader2 = null;
    String redirect = "";
   
    URI uri = null;
   
    msg = getNewMsg();
    try {
        sendAndReceive(msg, false);
        if (msg.getResponseHeader().getStatusCode() != HttpStatusCode.MOVED_PERMANENTLY
                && msg.getResponseHeader().getStatusCode() != HttpStatusCode.FOUND) {
            // not redirect page, return;
            return;
        }
       
        locationHeader = msg.getResponseHeader().getHeader(HttpHeader.LOCATION);
        if (locationHeader == null) {
            return;
        }
       
        if (locationHeader.compareToIgnoreCase(value) == 0) {
            // URI found in param
            redirect = redirect1;
        } else if (locationHeader.compareToIgnoreCase(getURLDecode(value)) == 0) {
            redirect = getURLEncode(redirect1);
        }

        if (redirect != null) {
          uri = new URI(locationHeader, true);
          locationHeader2 = uri.getPathQuery();
          if (locationHeader2.compareToIgnoreCase(value) == 0) {
              // path and query found in param
              redirect = redirect2;
          } else if (locationHeader2.compareToIgnoreCase(getURLDecode(value)) == 0) {
              redirect = getURLEncode(redirect2);
View Full Code Here

        }

        for (int j=0; j<fileList.length; j++) {
          file = fileList[j].trim();
          try {
              URI uri = createURI(baseURI, dir, file);
              listURI.add(uri);
          } catch (URIException eu) {
          }
        }
      }
View Full Code Here

    if (!file.startsWith("/") && !dir.endsWith("/")) {
      file = "/" + file;
    }
       
    String path = dir + file;
    URI uri = new URI(base, path, true);
    return uri;
  }
View Full Code Here

        baseURI = getBaseMsg().getRequestHeader().getURI();
  }

    public void scan() {
        for (int i=0; i<getListURI().size() && !isStop(); i++) {
            URI uri = (URI) getListURI().get(i);
            HttpMessage msg = getNewMsg();
            try {
                msg.getRequestHeader().setURI(uri);
                msg.getRequestBody().setLength(0);
                sendAndReceive(msg);
                if (isFileExist(msg)) {
                    bingo(Alert.RISK_MEDIUM, Alert.SUSPICIOUS, uri.toString(), "", "", msg);
                }
            } catch (Exception e) {
            }
        }
    }
View Full Code Here

        Base[] bases = getBases();
        if (bases.length > 0) {
            if (bases[0].getHref().length() >0) {
                // base href exists
                try {
                    uri = new URI(bases[0].getHref(), false);
                } catch (Exception e) {
                }
            }
        }
       
View Full Code Here

    }
   

  private void checkIfDirectory(HttpMessage msg) throws URIException {

      URI uri = msg.getRequestHeader().getURI();
      uri.setQuery(null);
      String sUri = uri.toString();
    if (!sUri.endsWith("/")) {
      sUri = sUri + "/";
    }
    msg.getRequestHeader().setURI(new URI(sUri, true));
 
  }
View Full Code Here

     * @throws URIException
     * @throws HttpMalformedHeaderException
     */
    private HttpMessage buildMsg(URI base, String link) throws URIException, HttpMalformedHeaderException {

        URI uri = null;       
        uri = new URI(base, link, true);
        HttpMessage msg = new HttpMessage(new HttpRequestHeader(HttpRequestHeader.GET, uri, HttpHeader.HTTP11));
        return msg;
    }
View Full Code Here

    }
   
  void collect(Html html, int currentDepth) {
      Vector previousFoundList = new Vector();

      URI uri = null;
      A[] as = html.getAs();
      Frame[] frames = html.getFrames();
//      Img[] imgs = html.getImgs();
      Hyperlink[] hlinks = html.getHyperlinks();
      Meta[] metas = html.getMetas();
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.URI$CharsetChanged

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.