Examples of parseHeaders()


Examples of org.archive.wayback.core.Resource.parseHeaders()

    try {
      InputStream is = slr.getInputStream();
     
      r = loadResource(path, is);
     
      r.parseHeaders();
     
      success = true;
     
    } finally {
      if (!success) {
View Full Code Here

Examples of org.archive.wayback.core.Resource.parseHeaders()

        //System.out.println(new String(recordBytes, "UTF-8"));
        WARCRecordInfo recinfo = new TestWARCRecordInfo(recordBytes);
        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();
        // expectations
        response.setStatus(200);
View Full Code Here

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

    public static Resource createTestHtmlResource(byte[] payloadBytes) throws IOException {
        WARCRecordInfo recinfo = TestWARCRecordInfo.createCompressedHttpResponse("text/html", payloadBytes);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource resource = new WarcResource(rec, ar);
        resource.parseHeaders();
        return resource;
    }
   
    /**
     * test basic behavior with simple input.
View Full Code Here

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

  public static Resource createTestJSResource(byte[] payloadBytes) throws IOException {
    WARCRecordInfo recinfo = TestWARCRecordInfo.createHttpResponse("text/javascript", payloadBytes);
    TestWARCReader ar = new TestWARCReader(recinfo);
    WARCRecord rec = ar.get(0);
    WarcResource resource = new WarcResource(rec, ar);
    resource.parseHeaders();
    return resource;
  }
  /**
   * multi-component test with typical usage pattern:
   * rewriting {@code https://} to {@code http://} in proxy-mode.
View Full Code Here

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

    public static Resource createTestHtmlResource(byte[] payloadBytes) throws IOException {
        WARCRecordInfo recinfo = TestWARCRecordInfo.createCompressedHttpResponse("text/html", payloadBytes);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource resource = new WarcResource(rec, ar);
        resource.parseHeaders();
        return resource;
    }
    public static Resource createTestRevisitResource(byte[] payloadBytes, boolean withHeader, boolean gzipContent) throws IOException {
        WARCRecordInfo recinfo = TestWARCRecordInfo.createRevisitHttpResponse(
                "text/html", payloadBytes.length, withHeader, gzipContent);
View Full Code Here

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

        WARCRecordInfo recinfo = TestWARCRecordInfo.createRevisitHttpResponse(
                "text/html", payloadBytes.length, withHeader, gzipContent);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource resource = new WarcResource(rec, ar);
        resource.parseHeaders();
        return resource;
    }
   
    /**
     * test basic behavior with simple input.
View Full Code Here

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

        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);
View Full Code Here

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

                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);
View Full Code Here

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

        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

Examples of org.archive.wayback.resourcestore.resourcefile.WarcResource.parseHeaders()

        //System.out.println(new String(recordBytes, "UTF-8"));
        WARCRecordInfo recinfo = new TestWARCRecordInfo(recordBytes);
        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();
        // expectations
        response.setStatus(200);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.