Package org.archive.wayback.core

Examples of org.archive.wayback.core.Resource


      //if ((redir != null) && !redir.equals("-")) {
      //  String fullRedirect = getUriConverter().makeReplayURI(closest.getCaptureTimestamp(), redir);
      //  throw new BetterRequestException(fullRedirect, Integer.valueOf(closest.getHttpCode()));
      //}
     
      Resource httpHeadersResource = null;
      Resource payloadResource = null;
      boolean isRevisit = false;
     
      try {
        counter++;
       
View Full Code Here


    public void testRenderResource_BasicCapture() throws Exception {
        final String ct = "image/gif";
        WARCRecordInfo recinfo = TestWARCRecordInfo.createHttpResponse(ct, TestWARCRecordInfo.PAYLOAD_GIF);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        Resource payloadResource = new WarcResource(rec, ar);
        payloadResource.parseHeaders();
        Resource headersResource = payloadResource;
       
        TestServletOutputStream servletOutput = new TestServletOutputStream();
        response.setStatus(200);
        EasyMock.expect(response.getOutputStream()).andReturn(servletOutput);
        response.setHeader("Content-Type", ct);
View Full Code Here

        WARCRecordInfo recinfo = new TestWARCRecordInfo(
                TestWARCRecordInfo.buildCompressedHttpResponseBlock(ct,
                        TestWARCRecordInfo.PAYLOAD_GIF));
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        Resource payloadResource = new WarcResource(rec, ar);
        payloadResource.parseHeaders();
        Resource headersResource = payloadResource;
       
        TestServletOutputStream servletOutput = new TestServletOutputStream();
        response.setStatus(200);
        EasyMock.expect(response.getOutputStream()).andReturn(servletOutput);
        response.setHeader("Content-Type", ct);
View Full Code Here

    public void testRenderResource_Redirect() throws Exception {
        String location = "http://www.example.com/index.html";
        WARCRecordInfo recinfo = new TestWARCRecordInfo(TestWARCRecordInfo.buildHttpRedirectResponseBlock(location));
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        Resource payloadResource = new WarcResource(rec, ar);
        payloadResource.parseHeaders();
       
        final String originalUrl = "http://www.example.com/";
        final String captureTimestamp = "20130101123456";
       
        result.setOriginalUrl(originalUrl);
View Full Code Here

TOP

Related Classes of org.archive.wayback.core.Resource

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.