public class CdxWriter extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
onWarning(java.util.function.Consumer<String> warningHandler)
Sets a handler for warnings emitted during processing.
|
void |
process(List<Path> warcFiles,
boolean useAbsolutePaths)
Processes a list of WARC files writing CDX records for each response or resource record.
|
void |
process(WarcReader reader,
String filename)
Writes CDX records for each response or resource record in a WARC file.
|
void |
setFormat(CdxFormat format)
Sets the CDX output format to use.
|
void |
setPostAppend(boolean postAppend)
Appends an encoded version of the request to the URL key for POST and PUT requests.
|
void |
setRecordFilter(java.util.function.Predicate<WarcRecord> recordFilter)
Records that don't match this filter will not be emitted.
|
void |
write(WarcCaptureRecord capture,
String filename,
long position,
long length)
Writes a CDX record.
|
void |
write(WarcCaptureRecord capture,
String filename,
long position,
long length,
String encodedRequest)
Writes a CDX record with an encoded request body appended to the urlkey field.
|
void |
writeHeaderLine()
Writes a CDX header line.
|
public CdxWriter(Writer writer)
public void writeHeaderLine()
throws IOException
IOExceptionpublic void write(WarcCaptureRecord capture, String filename, long position, long length) throws IOException
IOExceptionpublic void write(WarcCaptureRecord capture, String filename, long position, long length, String encodedRequest) throws IOException
IOExceptionCdxRequestEncoder.encode(HttpRequest)public void process(List<Path> warcFiles, boolean useAbsolutePaths) throws IOException
IOExceptionpublic void process(WarcReader reader, String filename) throws IOException
IOExceptionpublic void setRecordFilter(java.util.function.Predicate<WarcRecord> recordFilter)
public void setFormat(CdxFormat format)
CdxFormat.Builderpublic void setPostAppend(boolean postAppend)
public void onWarning(java.util.function.Consumer<String> warningHandler)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2024. All rights reserved.