Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
3.8
-
None
Description
Since Heritrix 1.14.0 the ARCWriter.writer(String uri String contentType String hostIP long fetchBeginTimeStamp long recordLength ByteArrayOutputStream baos) has been deprecated.
One should instead use the method ARCWriter.write(String uri String contentType String hostIP long fetchBeginTimeStamp long recordLength InputStream in)
I have looked at how to convert the code in the HarvestController.writePreharvestMetadata() method.
Here the code
for (MetadataEntry m : metadata) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write(m.getData());
aw.write(m.getURL() m.getMimeType()
SystemUtils.getLocalIP()
System.currentTimeMillis()
m.getData().length baos);
}
should simply be changed to
for (MetadataEntry m : metadata) {
ByteArrayInputStream bais
= new ByteArrayInputStream(m.getData());
aw.write(m.getURL() m.getMimeType()
SystemUtils.getLocalIP()
System.currentTimeMillis()
m.getData().length bais);
}
The class dk.netarkivet.harvester.tools.CreateCDXMetadataFile also uses
this deprecated method.