Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log
Logging output place.
|
Constructor and Description |
---|
WARCUtils() |
Modifier and Type | Method and Description |
---|---|
static org.archive.io.warc.WARCWriter |
createWARCWriter(File newFile)
Create new WARCWriter, writing to warcfile newFile.
|
static String |
getRecordType(org.archive.io.warc.WARCRecord record)
Find out what type of WARC-record this is.
|
static void |
insertWARCFile(File warcFile,
org.archive.io.warc.WARCWriter writer)
Insert the contents of a WARC file into another WARCFile.
|
static boolean |
isWarc(String filename)
Check if the given filename represents a WARC file.
|
static byte[] |
readWARCRecord(org.archive.io.warc.WARCRecord record)
Read the contents (payload) of an WARC record into a byte array.
|
protected static final org.slf4j.Logger log
public WARCUtils()
public static org.archive.io.warc.WARCWriter createWARCWriter(File newFile)
newFile
- the WARCfile, that the WARCWriter writes to.public static void insertWARCFile(File warcFile, org.archive.io.warc.WARCWriter writer)
warcFile
- An WARC file to read.writer
- A place to write the arc recordsIOFailure
- if there are problems reading the file.public static byte[] readWARCRecord(org.archive.io.warc.WARCRecord record) throws IOFailure
record
- An WARC record to read from. After reading, the WARC Record will no longer have its own data
available for reading.IOFailure
- If there is an error reading the data, or if the record is longer than Integer.MAX_VALUE (since
we can't make bigger arrays).public static String getRecordType(org.archive.io.warc.WARCRecord record)
record
- a given WARCRecordCopyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.