Package org.archive.wayback.resourcestore.resourcefile

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource


        TestWARCRecordInfo recinfo = TestWARCRecordInfo.createCompressedHttpResponse("text/html", payloadBytes);
        recinfo.setCreate14DigitDateFromDT14(timestamp);
        if (uri != null) recinfo.setUrl(uri);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource resource = new WarcResource(rec, ar);
        resource.parseHeaders();
        return resource;
    }
View Full Code Here


    public static Resource createTestRevisitResource(String timestamp, int len, boolean withHeader) throws IOException {
        TestWARCRecordInfo recinfo = TestWARCRecordInfo.createRevisitHttpResponse("text/html", len, withHeader);
        recinfo.setCreate14DigitDateFromDT14(timestamp);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource resource = new WarcResource(rec, ar);
        resource.parseHeaders();
        return resource;
    }
View Full Code Here

        byte[] content = TestWARCRecordInfo.buildHttpResponseBlock("502 Bad Gateway", "text/plain", failPayload);
 
        TestWARCRecordInfo recinfo = new TestWARCRecordInfo(content);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource resource = new WarcResource(rec, ar);
        resource.parseHeaders();
        return resource;
    }
View Full Code Here

  protected boolean isWarcRevisitNotModified(Resource warcRevisitResource) {
    if (!(warcRevisitResource instanceof WarcResource)) {
      return false;
    }
    WarcResource wr = (WarcResource) warcRevisitResource;
    Map<String,Object> warcHeaders = wr.getWarcHeaders().getHeaderFields();
    String warcProfile = (String) warcHeaders.get("WARC-Profile");
    return warcProfile != null
        && warcProfile.equals("http://netpreserve.org/warc/1.0/revisit/server-not-modified");
  }
View Full Code Here

    String payloadUri = null;
    String payloadTimestamp = null;
   
    if (warcHeaders == null) {
      WarcResource wr = (WarcResource) revisitRecord;
      warcHeaders = wr.getWarcHeaders().getHeaderFields();
    }
   
    if (warcHeaders != null) {
      payloadUri = (String) warcHeaders.get("WARC-Refers-To-Target-URI");
     
View Full Code Here

TOP

Related Classes of org.archive.wayback.resourcestore.resourcefile.WarcResource

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.