Package org.archive.wayback.exception

Examples of org.archive.wayback.exception.BetterRequestException


    // redirect to the better version:
    ArchivalUrl aUrl = new ArchivalUrl(wbRequest);
    String betterUrl = wbRequest.getAccessPoint().getReplayPrefix() +
      aUrl.toString(closest.getCaptureTimestamp(),
        closest.getOriginalUrl());
    throw new BetterRequestException(betterUrl);
  }
View Full Code Here


        if (!bestPath.equals(requestPath)) {
          String betterURI = (wbRequest.isReplayRequest() ?
              accessPoint.getReplayPrefix() :
                accessPoint.getQueryPrefix())
              + bestPath;
          throw new BetterRequestException(betterURI);
        }
      }
    }
    return wbRequest;
  }
View Full Code Here

            if (wbRequest.isReplayRequest()) {
              String replayTimestamp = wbRequest.getReplayTimestamp();
              if (replayTimestamp != null) {
                BDBMap.addTimestampForId(httpRequest.getContextPath(),
                    id, replayTimestamp);
                throw new BetterRequestException(wbRequest.getRequestUrl());
              }
            }
                   
              // Then get the timestamp (or rather datestr) matching this id.
              // TODO: This is hacky - need generic way to store session data
View Full Code Here

    String url = closest.getOriginalUrl();
    String captureDate = closest.getCaptureTimestamp();
    ResultURIConverter uriConverter =
      wbRequest.getAccessPoint().getUriConverter();
    String betterURI = uriConverter.makeReplayURI(captureDate,url);
    throw new BetterRequestException(betterURI);
  }
View Full Code Here

      // and copy the stored up byte-stream:
      baos.writeTo(httpResponse.getOutputStream());
    } catch (Exception e) {

      // Redirect to identity if there are any issues
      throw new BetterRequestException(UrlOperations.computeIdentityUrl(wbRequest));
    }
  }
View Full Code Here

        } catch (UnsupportedEncodingException e) {
          // not gonna happen...
          u.append(sb.toString());
        }

        throw new BetterRequestException(u.toString());
      }
    }
  }
View Full Code Here

        MementoUtils.addOrigHeader(httpResponse, closest.getOriginalUrl());
      }
    }
   
    if (!isNonRedirectProxy) {
        throw new BetterRequestException(betterURI);
    }
  }
View Full Code Here

TOP

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

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.