public class WarcWriter extends Object implements Closeable
Compression is not yet implemented.
| Constructor and Description |
|---|
WarcWriter(OutputStream stream) |
WarcWriter(WritableByteChannel channel) |
WarcWriter(WritableByteChannel channel,
WarcCompression compression) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
fetch(URI uri)
Downloads a remote resource recording the request and response as WARC records.
|
void |
fetch(URI uri,
HttpRequest httpRequest,
OutputStream copyTo)
Downloads a remote resource recording the request and response as WARC records.
|
long |
position()
Returns the byte position the next record will be written to.
|
void |
write(WarcRecord record) |
public WarcWriter(WritableByteChannel channel, WarcCompression compression) throws IOException
IOExceptionpublic WarcWriter(WritableByteChannel channel) throws IOException
IOExceptionpublic WarcWriter(OutputStream stream) throws IOException
IOExceptionpublic void write(WarcRecord record) throws IOException
IOExceptionpublic void fetch(URI uri) throws IOException
IOExceptionpublic void fetch(URI uri, HttpRequest httpRequest, OutputStream copyTo) throws IOException
uri - to downloadhttpRequest - request to sendcopyTo - if not null will receive a copy of the (raw) http response bytesIOExceptionpublic long position()
If the underlying channel is not seekable the returned value will be relative to the position the channel was in when the WarcWriter was created.
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2022. All rights reserved.