Examples of WARCRecordInfo


Examples of org.archive.io.warc.WARCRecordInfo

  protected void setUp() throws Exception {
    super.setUp();
  }
 
  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;
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

        result = new CaptureSearchResult();
        result.setOriginalUrl("http://www.example.com/");
    }
   
    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;
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

        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);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource resource = new WarcResource(rec, ar);
        resource.parseHeaders();
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

     * plain HTTP response (without any transfer/content-encoding)
     * @throws Exception
     */
    public void testPlainHttpRecord() throws Exception {
        String payload = "hogehogehogehogehoge";
        WARCRecordInfo recinfo = TestWARCRecordInfo.createHttpResponse(payload);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource res = new WarcResource(rec, ar);
        res.parseHeaders();
       
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

     * uncompressed, but chunked-encoded HTTP response
     * @throws Exception
     */
    public void testPlainChunkedHttpRecord() throws Exception {
        String payload = "hogehogehogehogehoge";
        WARCRecordInfo recinfo = new TestWARCRecordInfo(
                TestWARCRecordInfo.buildHttpResponseBlock("200 OK",
                        "text/plain", payload.getBytes("UTF-8"), true));
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource res = new WarcResource(rec, ar);
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

     * @throws Exception
     */
    public void testCompressedHttpRecord() throws Exception {
        String payload = "hogehogehogehogehoge";
        String ctype = "text/plain";
        WARCRecordInfo recinfo = new TestWARCRecordInfo(
                TestWARCRecordInfo.buildCompressedHttpResponseBlock(ctype,
                        payload.getBytes()));
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource res = new WarcResource(rec, ar);
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

     * @throws Exception
     */
    public void testCompressedChunkedHttpRecord() throws Exception {
        String payload = "hogehogehogehogehoge";
        String ctype = "text/plain";
        WARCRecordInfo recinfo = new TestWARCRecordInfo(
                TestWARCRecordInfo.buildCompressedHttpResponseBlock(ctype,
                        payload.getBytes(), true));
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource res = new WarcResource(rec, ar);
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

                71, 73, 70, 56, 57, 97, 1, 0, 1, 0, -128, 0, 0, -64, -64, -64,
                0, 0, 0, 33, -7, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0,
                1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59, 13, 10, 13, 10
        };
        final String ct = "image/gif";
        WARCRecordInfo recinfo = new TestWARCRecordInfo(block);
        recinfo.setType(WARCRecordType.metadata);
        recinfo.setMimetype(ct);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource res = new WarcResource(rec, ar);
        // must not fail
        res.parseHeaders();
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

     * </ul>
     * @throws Exception
     */
    public void testRevisitRecord() throws Exception {
        final String ct = "text/html";
        WARCRecordInfo recinfo = TestWARCRecordInfo.createRevisitHttpResponse(ct, 1345);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource res = new WarcResource(rec, ar);
        res.parseHeaders();
       
View Full Code Here

Examples of org.archive.io.warc.WARCRecordInfo

     * @see TextReplayRenderer
     * @see StandardCharsetDetector#getCharset(org.archive.wayback.core.Resource, org.archive.wayback.core.Resource, org.archive.wayback.core.WaybackRequest)
     */
    public void testOldRevisitRecord() throws Exception {
        final String ct = "text/html";
        WARCRecordInfo recinfo = TestWARCRecordInfo.createRevisitHttpResponse(ct, 1345, false);
        TestWARCReader ar = new TestWARCReader(recinfo);
        WARCRecord rec = ar.get(0);
        WarcResource res = new WarcResource(rec, ar);
        res.parseHeaders();
       
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.