Package org.archive.io

Examples of org.archive.io.RecoverableIOException


    }
   
        byte [] statusBytes = HttpParser.readRawLine(rec);
        int eolCharCount = getEolCharsCount(statusBytes);
        if (eolCharCount <= 0) {
            throw new RecoverableIOException("Failed to read http status where one " +
                " was expected: " + new String(statusBytes));
        }
        String statusLineStr = EncodingUtil.getString(statusBytes, 0,
            statusBytes.length - eolCharCount, ARCConstants.DEFAULT_ENCODING);
        if ((statusLineStr == null) ||
                !StatusLine.startsWithHTTP(statusLineStr)) {
           throw new RecoverableIOException("Failed parse of http status line.");
        }
        StatusLine statusLine = new StatusLine(statusLineStr);

        this.status = statusLine.getStatusCode();
View Full Code Here


    // does not implement this... yet..
   
        byte [] statusBytes = HttpParser.readRawLine(rec);
        int eolCharCount = getEolCharsCount(statusBytes);
        if (eolCharCount <= 0) {
            throw new RecoverableIOException("Failed to read http status where one " +
                " was expected: " + new String(statusBytes));
        }
        String statusLine = EncodingUtil.getString(statusBytes, 0,
            statusBytes.length - eolCharCount, ARCConstants.DEFAULT_ENCODING);
        if ((statusLine == null) ||
                !StatusLine.startsWithHTTP(statusLine)) {
           throw new RecoverableIOException("Failed parse of http status line.");
        }
        StatusLine status = new StatusLine(statusLine);
    result.put(WaybackConstants.RESULT_HTTP_CODE,
        String.valueOf(status.getStatusCode()));
       
View Full Code Here

    String rectypeStr = (String)rec.getHeader().getHeaderValue("WARC-Type");
    WARCRecordType rectype;
    try {
        rectype = WARCRecordType.valueOf(rectypeStr);
    } catch (IllegalArgumentException ex) {
        throw new RecoverableIOException("unrecognized WARC-Type \"" + rectypeStr + "\"");
    }
   
    if (rectype == WARCRecordType.response || rectype == WARCRecordType.revisit) {
        byte [] statusBytes = LaxHttpParser.readRawLine(rec);
        int eolCharCount = getEolCharsCount(statusBytes);
        if (eolCharCount <= 0) {
            throw new RecoverableIOException("Failed to read http status where one " +
                    " was expected: " + new String(statusBytes));
        }
        String statusLineStr = EncodingUtil.getString(statusBytes, 0,
                statusBytes.length - eolCharCount, ARCConstants.DEFAULT_ENCODING);
        if ((statusLineStr == null) ||
                !StatusLine.startsWithHTTP(statusLineStr)) {
            throw new RecoverableIOException("Failed parse of http status line.");
        }
        StatusLine statusLine = new StatusLine(statusLineStr);

        this.status = statusLine.getStatusCode();
View Full Code Here

    // does not implement this... yet..
   
        byte [] statusBytes = LaxHttpParser.readRawLine(rec);
        int eolCharCount = getEolCharsCount(statusBytes);
        if (eolCharCount <= 0) {
            throw new RecoverableIOException("Failed to read http status where one " +
                    " was expected: " +
                    ((statusBytes == null) ? "(null)" : new String(statusBytes)));
        }
        String statusLine = EncodingUtil.getString(statusBytes, 0,
            statusBytes.length - eolCharCount, ARCConstants.DEFAULT_ENCODING);
        if ((statusLine == null) ||
                !StatusLine.startsWithHTTP(statusLine)) {
           throw new RecoverableIOException("Failed parse of http status line.");
        }
        StatusLine status = new StatusLine(statusLine);
    result.setHttpCode(String.valueOf(status.getStatusCode()));
       
    Header[] headers = LaxHttpParser.parseHeaders(rec,
View Full Code Here

TOP

Related Classes of org.archive.io.RecoverableIOException

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.