Package org.archive.wayback.webapp

Examples of org.archive.wayback.webapp.AccessPoint


   * @param configName
   * @return String configuration for the context, if present, otherwise null
   */
  public String getContextConfig(final String configName) {
    String configValue = null;
    AccessPoint context = getWbRequest().getContext();
    if(context != null) {
      Properties configs = context.getConfigs();
      if(configs != null) {
        configValue = configs.getProperty(configName);
      }
    }
    return configValue;
View Full Code Here


  public static void printLinkTimemap(CaptureSearchResults results,
      WaybackRequest wbr, PrintWriter pw) {
    Date first = results.getFirstResultDate();
    Date last = results.getLastResultDate();
    AccessPoint ap = wbr.getAccessPoint();

    String requestUrl = wbr.getRequestUrl();
    // ludab nov30 2012

    String pagedate = wbr.get(PAGE_STARTS);
View Full Code Here

    CaptureSearchResult closest = nre.getClosest();
    CaptureSearchResult next = nre.getNext();
    CaptureSearchResult last = nre.getLast();
    ArrayList<String> rels = new ArrayList<String>();

    AccessPoint ap = wbr.getAccessPoint();

    String requestUrl = wbr.getRequestUrl();

    // add generics:
    // rels.add(makeLink(getTimebundleUrl(ap, requestUrl), TIMEBUNDLE));
View Full Code Here

        // and use it in RequestParser instead.
        // (partial) list of AccessPoint methods used by RequestParser:
        // - translateRequestPathQuery(HttpServletRequest) (defined in RequestHandler)
        // - getMapParam(Map, String) (static)
        // - isEnableMemento()
        accessPoint = new AccessPoint();
    }
View Full Code Here

   */
  public void testParseString() throws Exception {
    BaseRequestParser wrapped = new ArchivalUrlRequestParser();
    ReplayRequestParser p = new ReplayRequestParser(wrapped);
    WaybackRequest r;
    AccessPoint ap = null;
    r = p.parse("",ap);
    assertNull("Should not parse empty string", r);
    r = p.parse("20070101000000/foo.com",ap);
    assertNotNull("Should parse legit request sans scheme", r);
    assertEquals("parsed request Url",r.getRequestUrl(),"http://foo.com");
View Full Code Here

   * @param configName key for configuration property
   * @return String configuration for the context, if present, otherwise null
   */
  public String getContextConfig(final String configName) {
    String configValue = null;
    AccessPoint context = getWbRequest().getAccessPoint();
    if(context != null) {
      Properties configs = context.getConfigs();
      if(configs != null) {
        configValue = configs.getProperty(configName);
      }
    }

View Full Code Here

      return super.createAccessFilter(apToken);
    }
   
    apToken = (APContextAuthToken)token;
   
    AccessPoint ap = apToken.ap;
   
    FilenamePrefixFilter include = null, exclude = null;
   
    if (ap.getFileIncludePrefixes() != null) {
      include = new FilenamePrefixFilter();
      include.setExclusion(false);
      include.setPrefixList(ap.getFileIncludePrefixes());
    }
   
    if (ap.getFileExcludePrefixes() != null) {
      exclude = new FilenamePrefixFilter();
      exclude.setExclusion(true);
      exclude.setPrefixList(ap.getFileExcludePrefixes());
    }
   
    ExclusionFilter adminFilter = null;
    if (adminExclusions != null) {
      adminFilter = adminExclusions.get();
View Full Code Here

  private ObjectFilterChain<CaptureSearchResult> chain = null;
  private final static String[] sA = new String[0];

  public AccessPointCaptureFilterGroup(WaybackRequest request) {
    chain = new ObjectFilterChain<CaptureSearchResult>();
    AccessPoint accessPoint = request.getAccessPoint();
    List<String> prefixes = null;
    if(request.getAccessPoint() != null) {
      prefixes = accessPoint.getFileIncludePrefixes();
      if(prefixes != null && prefixes.size() > 0) {
        FilePrefixFilter f = new FilePrefixFilter();
        f.setPrefixes(prefixes.toArray(sA));
        chain.addFilter(f);
      }
      prefixes = accessPoint.getFileExcludePrefixes();
      if(prefixes != null && prefixes.size() > 0) {
        FilePrefixFilter f = new FilePrefixFilter();
        f.setIncludeMatches(false);
        f.setPrefixes(prefixes.toArray(sA));
        chain.addFilter(f);
      }
     
     
      List<String> patterns = accessPoint.getFilePatterns();
      if(patterns != null && patterns.size() > 0) {
        FileRegexFilter f = new FileRegexFilter();
        f.setPatterns(patterns);
        chain.addFilter(f);
      }
      long embargoMS = accessPoint.getEmbargoMS();
      if(embargoMS > 0) {
        chain.addFilter(new DateEmbargoFilter(embargoMS));
      }
      CustomResultFilterFactory factory = accessPoint.getFilterFactory();
      if(factory != null) {
        ObjectFilter<CaptureSearchResult> filter =
          factory.get(accessPoint);
        if(filter != null) {
          chain.addFilter(filter);
View Full Code Here

 
  protected boolean noMatchesDefault = true;

  @Override
  public boolean isTrue(WaybackRequest value) {
    AccessPoint ap = value.getAccessPoint();
   
    String path = ap.getAccessPointPath();
   
    if (path == null) {
      return noMatchesDefault;
    }
   
View Full Code Here

    return null;
  }
 
  public static String computeIdentityUrl(WaybackRequest wbRequest)
  {
    AccessPoint accessPoint = wbRequest.getAccessPoint();

    boolean origIdentity = wbRequest.isIdentityContext();
    wbRequest.setIdentityContext(true);
   
    ArchivalUrl aUrl = new ArchivalUrl(wbRequest);
    String bestPath = aUrl.toString();
    String betterURI = accessPoint.getReplayPrefix() + bestPath;

    //reset the isIdentity flag just in case
    wbRequest.setIdentityContext(origIdentity);
   
    return betterURI;
View Full Code Here

TOP

Related Classes of org.archive.wayback.webapp.AccessPoint

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.