|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.harvester.harvesting.metadata.MetadataFileWriter
dk.netarkivet.harvester.harvesting.metadata.MetadataFileWriterWarc
public class MetadataFileWriterWarc
MetadataFileWriter that writes to WARC files.
Field Summary |
---|
Fields inherited from class dk.netarkivet.harvester.harvesting.metadata.MetadataFileWriter |
---|
MDF_ARC, MDF_WARC, metadataFormat |
Constructor Summary | |
---|---|
MetadataFileWriterWarc()
|
Method Summary | |
---|---|
void |
close()
Close the metadatafile Writer. |
static MetadataFileWriter |
createWriter(java.io.File metadataWarcFile)
Create a MetadataFileWriter for WARC output. |
java.io.File |
getFile()
|
void |
insertInfoRecord(org.archive.util.anvl.ANVLRecord payloadToInfoRecord)
Insert a warcInfoRecord in the WARC-file, if it doesn't already exists. |
void |
write(java.lang.String uri,
java.lang.String contentType,
java.lang.String hostIP,
long fetchBeginTimeStamp,
byte[] payload)
Write a record to the archive file. |
void |
writeFileTo(java.io.File file,
java.lang.String uri,
java.lang.String mime)
Write the given file to the metadata file. |
boolean |
writeTo(java.io.File fileToArchive,
java.lang.String URL,
java.lang.String mimetype)
Writes a File to an ARCWriter, if available, otherwise logs the failure to the class-logger. |
Methods inherited from class dk.netarkivet.harvester.harvesting.metadata.MetadataFileWriter |
---|
getMetadataArchiveFileName, initializeMetadataFormat, insertFiles, resetMetadataFormat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetadataFileWriterWarc()
Method Detail |
---|
public static MetadataFileWriter createWriter(java.io.File metadataWarcFile)
MetadataFileWriter
for WARC output.
metadataWarcFile
- The WARC output file
MetadataFileWriter
for writing metadata files in WARCpublic void close()
MetadataFileWriter
close
in class MetadataFileWriter
public java.io.File getFile()
getFile
in class MetadataFileWriter
public void insertInfoRecord(org.archive.util.anvl.ANVLRecord payloadToInfoRecord)
payloadToInfoRecord
- the given payload for this record.public void writeFileTo(java.io.File file, java.lang.String uri, java.lang.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(java.io.File fileToArchive, java.lang.String URL, java.lang.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-contents
public void write(java.lang.String uri, java.lang.String contentType, java.lang.String hostIP, long fetchBeginTimeStamp, byte[] payload) throws java.io.IOException
MetadataFileWriter
write
in class MetadataFileWriter
uri
- record URIcontentType
- content-type of recordhostIP
- resource ip-addressfetchBeginTimeStamp
- record datetimepayload
- A byte array containing the payload
java.io.IOException
ARCWriter.write(String uri, String contentType, String hostIP,
long fetchBeginTimeStamp, long recordLength, InputStream in)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |