public class MetadataFileWriterWarc extends MetadataFileWriter
CDX_URI_SCHEME, MDF_ARC, MDF_WARC, metadataFormat
Constructor and Description |
---|
MetadataFileWriterWarc() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the metadatafile Writer.
|
static MetadataFileWriter |
createWriter(File metadataWarcFile)
Create a
MetadataFileWriter for WARC output. |
File |
getFile() |
void |
insertInfoRecord(org.jwat.common.ANVLRecord payloadToInfoRecord)
Insert a warcInfoRecord in the WARC-file, if it doesn't already exists.
|
protected void |
open() |
void |
write(String uri,
String contentType,
String hostIP,
long fetchBeginTimeStamp,
byte[] payload)
Write a record to the archive file.
|
void |
writeFileTo(File file,
String uri,
String mime)
Write the given file to the metadata file.
|
boolean |
writeTo(File fileToArchive,
String URL,
String mimetype)
Writes a File to an ARCWriter, if available, otherwise logs the failure to the class-logger.
|
compressRecords, getAlternateCDXURI, getCDXURI, getMetadataArchiveFileName, initializeMetadataFormat, insertFiles, resetMetadataFormat
public MetadataFileWriterWarc()
public static MetadataFileWriter createWriter(File metadataWarcFile)
MetadataFileWriter
for WARC output.metadataWarcFile
- The WARC output fileMetadataFileWriter
for writing metadata files in WARCprotected void open()
public void close()
MetadataFileWriter
close
in class MetadataFileWriter
public File getFile()
getFile
in class MetadataFileWriter
public void insertInfoRecord(org.jwat.common.ANVLRecord payloadToInfoRecord)
payloadToInfoRecord
- the given payload for this record.public void writeFileTo(File file, String uri, String mime)
MetadataFileWriter
writeFileTo
in class MetadataFileWriter
file
- A given file with metadata to write to the metadata archive file.uri
- The uri associated with the piece of metadatamime
- The mimetype associated with the piece of metadatapublic boolean writeTo(File fileToArchive, String URL, String mimetype)
MetadataFileWriter
writeTo
in class MetadataFileWriter
fileToArchive
- the File to archiveURL
- the URL with which it is stored in the arcfilemimetype
- The mimetype of the File-contentspublic void write(String uri, String contentType, String hostIP, long fetchBeginTimeStamp, byte[] payload) throws IOException
MetadataFileWriter
write
in class MetadataFileWriter
uri
- record URIcontentType
- content-type of recordhostIP
- resource ip-addressfetchBeginTimeStamp
- record datetimepayload
- A byte array containing the payloadIOException
ARCWriter.write(String uri, String contentType, String hostIP, long fetchBeginTimeStamp,
long recordLength, InputStream in)
Copyright © 2005–2018 The Royal Danish Library, the National Library of France and the Austrian National Library.. All rights reserved.