protected URI writeRequest(final WARCWriter w, final String timestamp, final String mimetype, final URI baseid, final CrawlURI curi, final ANVLRecord namedFields) throws IOException { WARCRecordInfo recordInfo = new WARCRecordInfo(); recordInfo.setType(WARCRecordType.request); recordInfo.setUrl(curi.toString()); recordInfo.setCreate14DigitDate(timestamp); recordInfo.setMimetype(mimetype); recordInfo.setExtraHeaders(namedFields); recordInfo.setContentLength(curi.getRecorder().getRecordedOutput().getSize()); recordInfo.setEnforceLength(true); final URI uid = qualifyRecordID(baseid, TYPE, WARCRecordType.request.toString()); recordInfo.setRecordId(uid); ReplayInputStream ris = curi.getRecorder().getRecordedOutput().getReplayInputStream(); recordInfo.setContentStream(ris); try { w.writeRecord(recordInfo); } finally { IOUtils.closeQuietly(ris); } return recordInfo.getRecordId(); }
/** * Return a replay stream, cued up to begining of content * * @throws IOException * @return An RIS. */ public ReplayInputStream getMessageBodyReplayInputStream() throws IOException { return getReplayInputStream(this.messageBodyBeginMark); }
/** * Return a replay stream, cued up to begining of content * * @throws IOException * @return An RIS. */ public ReplayInputStream getMessageBodyReplayInputStream() throws IOException { return getReplayInputStream(this.messageBodyBeginMark); }
public ReplayInputStream getReplayInputStream() throws IOException { return this.recordingOutputStream.getReplayInputStream(); }
/** * Return a replay stream, cued up to begining of content * * @throws IOException * @return An RIS. */ public ReplayInputStream getMessageBodyReplayInputStream() throws IOException { return getReplayInputStream(this.messageBodyBeginMark); }
public ReplayInputStream getReplayInputStream() throws IOException { return this.recordingOutputStream.getReplayInputStream(); }
public ReplayInputStream getReplayInputStream() throws IOException { return this.recordingOutputStream.getReplayInputStream(); }
public ReplayInputStream getReplayInputStream(long skip) throws IOException { // If this method is being called, then assumption must be that the // stream is closed. If it ain't, then the stream gotten won't work // -- the size will zero so any attempt at a read will get back EOF. assert this.out == null: "Stream is still open."; ReplayInputStream replay = new ReplayInputStream(this.buffer, this.size, this.messageBodyBeginMark, this.backingFilename); replay.skip(skip); return replay; }
public ReplayInputStream getReplayInputStream(long skip) throws IOException { // If this method is being called, then assumption must be that the // stream is closed. If it ain't, then the stream gotten won't work // -- the size will zero so any attempt at a read will get back EOF. assert this.out == null: "Stream is still open."; ReplayInputStream replay = new ReplayInputStream(this.buffer, this.size, this.messageBodyBeginMark, this.backingFilename); replay.skip(skip); return replay; }
public ReplayInputStream getReplayInputStream(long skip) throws IOException { // If this method is being called, then assumption must be that the // stream is closed. If it ain't, then the stream gotten won't work // -- the size will zero so any attempt at a read will get back EOF. assert this.out == null: "Stream is still open."; ReplayInputStream replay = new ReplayInputStream(this.buffer, this.size, this.messageBodyBeginMark, this.backingFilename); replay.skip(skip); return replay; }
protected URI writeRequest(final WARCWriter w, final String timestamp, final String mimetype, final URI baseid, final CrawlURI curi, final ANVLRecord namedFields) throws IOException { WARCRecordInfo recordInfo = new WARCRecordInfo(); recordInfo.setType(WARCRecordType.request); recordInfo.setUrl(curi.toString()); recordInfo.setCreate14DigitDate(timestamp); recordInfo.setMimetype(mimetype); recordInfo.setExtraHeaders(namedFields); recordInfo.setContentLength(curi.getRecorder().getRecordedOutput().getSize()); recordInfo.setEnforceLength(true); final URI uid = qualifyRecordID(baseid, TYPE, WARCRecordType.request.toString()); recordInfo.setRecordId(uid); ReplayInputStream ris = curi.getRecorder().getRecordedOutput().getReplayInputStream(); recordInfo.setContentStream(ris); try { w.writeRecord(recordInfo); } finally { IOUtils.closeQuietly(ris); } return recordInfo.getRecordId(); }