Package org.archive.wayback.exception

Examples of org.archive.wayback.exception.ResourceNotInArchiveException


      if (exclusion != null) {
        if(preExCounter.getNumMatched() > 0) {
          throw new AccessControlException("All results Excluded");
        }
      }
      throw new ResourceNotInArchiveException("the URL " + keyUrl
          + " is not in the archive.");
    }

    // now we need to set some filter properties on the results:
    results.putFilter(WaybackConstants.REQUEST_URL, keyUrl);
View Full Code Here


     
      // TODO: Localization Problems.. Think of something clever.
      if(errTitle == null) {
        throw new ResourceIndexNotAvailableException("Unknown error!");
      } else if(errTitle.equals("Resource Not In Archive")) {
        throw new ResourceNotInArchiveException(errMessage);
      } else if(errTitle.equals("Bad Query Exception")) {
        throw new BadQueryException(errMessage);
      } else if(errTitle.equals("Resource Index Not Available Exception")) {
        throw new ResourceIndexNotAvailableException(errMessage);
      } else if(errTitle.equals("Access Control Exception")) {
View Full Code Here

        if(isForgedFailRecentEnough(result)) {
          LOGGER.info(url.toString() + " has failed recently");
          throw new LiveDocumentNotAvailableException("failed prev");
        } else {
          LOGGER.info(url.toString() + " failed a while ago");
          throw new ResourceNotInArchiveException("Nope");
        }
      }
      String name = (String) result.get(WaybackConstants.RESULT_ARC_FILE);
      long offset = Long.parseLong(
          (String) result.get(WaybackConstants.RESULT_OFFSET));
View Full Code Here

    NodeList channel = getSearchChannel(document);
    NodeList nodes = getSearchItems(document);

    if (channel == null || channel.getLength() != 1) {
      // TODO: better error for user:
         throw new ResourceNotInArchiveException("No results for " +
             requestUrl);
       }

       if (nodes == null) {
      // TODO: better error for user:
         throw new ResourceNotInArchiveException("No results for " +
             requestUrl);
       }

       for (int i = 0; i < nodes.getLength(); i++) {
        
View Full Code Here

    NodeList channel = getSearchChannel(document);
    NodeList nodes = getSearchItems(document);

    if (channel == null || channel.getLength() != 1) {
      // TODO: better error for user:
         throw new ResourceNotInArchiveException("No results for " +
             requestUrl);
       }

       if (nodes == null) {
      // TODO: better error for user:
         throw new ResourceNotInArchiveException("No results for " +
             requestUrl);
       }

       for (int i = 0; i < nodes.getLength(); i++) {
        
View Full Code Here

     
      // TODO: Localization Problems.. Think of something clever.
      if(errTitle == null) {
        throw new ResourceIndexNotAvailableException("Unknown error!");
      } else if(errTitle.equals("Resource Not In Archive")) {
        throw new ResourceNotInArchiveException(errMessage);
      } else if(errTitle.equals("Bad Query Exception")) {
        throw new BadQueryException(errMessage);
      } else if(errTitle.equals("Resource Index Not Available Exception")) {
        throw new ResourceIndexNotAvailableException(errMessage);
      } else if(errTitle.equals("Access Control Exception")) {
View Full Code Here

        numAdded++;
        results.addSearchResult(result, true);
      }
    }
    if(numAdded == 0) {
      throw new ResourceNotInArchiveException("No documents matching" +
          " filter");
    }
    return results;
  }
View Full Code Here

  throws BadQueryException, ResourceNotInArchiveException {
    results.setFirstReturned(startResult);
    results.setNumRequested(resultsPerPage);
    int startSeen = startFilter.getNumSeen();
    if(startSeen == 0) {
        ResourceNotInArchiveException e =
          new ResourceNotInArchiveException("the URL " + requestUrl
            + " is not in the archive.");
        e.setCloseMatches(results.getCloseMatches());
        throw e;
    }

    int numSeen = endFilter.getNumSeen();
    if(numSeen == 0) {
View Full Code Here

                  searchResults = resultWriter.getSearchResults();
              }
            }
           
            if (searchResults.getReturnedCount() == 0) {
              throw new ResourceNotInArchiveException(wbRequest.getRequestUrl() + " was not found");
            }
                   
        } catch (IOException e) {
          throw new ResourceIndexNotAvailableException(e.toString());
        } catch (RuntimeException rte) {
View Full Code Here

TOP

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

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.