Package org.archive.wayback.exception

Examples of org.archive.wayback.exception.BadQueryException


    }
       
    try {
      url = new URL(urlString);
    } catch(MalformedURLException e) {
      throw new BadQueryException("Bad URL(" + urlString + ")");
    }
   
    if ((skipHost != null) && skipHost.matcher(url.getHost()).find()) {
      return null;
    }
   
    if ((dnsCheckTimeout > 0) && !checkUrlDns(url, dnsCheckTimeout)) {
      return null;
    }

    result.setOriginalUrl(urlString);
   
    String canonUrl = urlString;
   
    if (inner.getSelfRedirectCanonicalizer() != null) {
      try {
        canonUrl = inner.getSelfRedirectCanonicalizer().urlStringToKey(urlString);
      } catch (IOException io) {
        throw new BadQueryException("Bad URL(" + urlString + ")");
      }
    }
   
    result.setUrlKey(canonUrl);
   
View Full Code Here


    if (scheme == null) {
      try {
        URL u = new URL(UrlOperations.HTTP_SCHEME + requestPath);
        // does the authority look legit?
        if (u.getUserInfo() != null) {
          throw new BadQueryException("Unable to handle URLs with user information");
        }
       
        if (UrlOperations.isAuthority(u.getAuthority())) {
          // ok, we're going to assume this is good:
          return handleDatelessRequest(accessPoint, requestPath, mementoDate);
View Full Code Here

    }
   
    try {
      urlkey = canon.urlStringToKey(wbRequest.getRequestUrl());
    } catch (URIException ue) {
      throw new BadQueryException(ue.toString());
    }

    //Do local access/url validation check   
        //AuthToken waybackAuthToken = new AuthToken(wbRequest.get(CDXServer.CDX_AUTH_TOKEN));
        AuthToken waybackAuthToken = createAuthToken(wbRequest, urlkey);
       
        CDXToSearchResultWriter resultWriter = null;
        SearchResults searchResults = null;
       
        if (wbRequest.isReplayRequest() || wbRequest.isCaptureQueryRequest()) {
      resultWriter = this.getCaptureSearchWriter(wbRequest, waybackAuthToken, false);
        } else if (wbRequest.isUrlQueryRequest()) {
      resultWriter = this.getUrlSearchWriter(wbRequest);
        } else {
          throw new BadQueryException("Unknown Query Type");
        }

        try {
          loadWaybackCdx(urlkey, wbRequest, resultWriter.getQuery(), waybackAuthToken, resultWriter, false);
         
            if (resultWriter.getErrorMsg() != null) {
              throw new BadQueryException(resultWriter.getErrorMsg());
            }
         
            searchResults = resultWriter.getSearchResults();
           
            if ((searchResults.getReturnedCount() == 0) && (wbRequest.isReplayRequest() || wbRequest.isCaptureQueryRequest()) && tryFuzzyMatch) {
View Full Code Here

TOP

Related Classes of org.archive.wayback.exception.BadQueryException

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.