|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.common.utils.warc.WARCUtils
public class WARCUtils
Various utilities on WARC-records. We have borrowed code from wayback. See org.archive.wayback.resourcestore.indexer.WARCRecordToSearchResultAdapter
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
Logging output place. |
Constructor Summary | |
---|---|
WARCUtils()
|
Method Summary | |
---|---|
static org.archive.io.warc.WARCWriter |
createWARCWriter(java.io.File newFile)
Create new WARCWriter, writing to warcfile newFile. |
static java.lang.String |
getRecordType(org.archive.io.warc.WARCRecord record)
Find out what type of WARC-record this is. |
static void |
insertWARCFile(java.io.File warcFile,
org.archive.io.warc.WARCWriter writer)
Insert the contents of a WARC file into another WARCFile. |
static boolean |
isWarc(java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public WARCUtils()
Method Detail |
---|
public static org.archive.io.warc.WARCWriter createWARCWriter(java.io.File newFile)
newFile
- the WARCfile, that the WARCWriter writes to.
public static void insertWARCFile(java.io.File warcFile, org.archive.io.warc.WARCWriter writer)
warcFile
- An WARC file to read.writer
- A place to write the arc records
IOFailure
- 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 java.lang.String getRecordType(org.archive.io.warc.WARCRecord record)
record
- a given WARCRecord
public static boolean isWarc(java.lang.String filename)
filename
- A given filename
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |