ar.addLabelValue("Filedesc", baos.toString()); List<String> metadata = new ArrayList<String>(1); metadata.add(ar.toString());
return Collections.singletonList(record.toString());
/** * @return This ANVLRecord as UTF8 bytes. */ public byte [] getUTF8Bytes() throws UnsupportedEncodingException { return toString().getBytes(UTF8); }
/** * @return This ANVLRecord as UTF8 bytes. */ public byte [] getUTF8Bytes() throws UnsupportedEncodingException { return toString().getBytes(UTF8); }
/** * @return This ANVLRecord as UTF8 bytes. */ public byte [] getUTF8Bytes() throws UnsupportedEncodingException { return toString().getBytes(UTF8); }
private void writeHeaderRecord(File target, File fieldsSrc, String id) throws IOException { WARCWriter writer = null; BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(target)); FileInputStream is = new FileInputStream(fieldsSrc); ANVLRecord ar = ANVLRecord.load(is); List<String> metadata = new ArrayList<String>(1); metadata.add(ar.toString()); writer = new WARCWriter(new AtomicInteger(),bos,target,getSettings(true, null, null, metadata)); // Write a warcinfo record with description about how this WARC // was made. writer.writeWarcinfoRecord(target.getName(), "Made from " + id + " by " + this.getClass().getName()); } private WARCWriterPoolSettings getSettings(final boolean isCompressed,
private void writeHeaderRecord(File target, File fieldsSrc, String id) throws IOException { WARCWriter writer = null; BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(target)); FileInputStream is = new FileInputStream(fieldsSrc); ANVLRecord ar = ANVLRecord.load(is); List<String> metadata = new ArrayList<String>(1); metadata.add(ar.toString()); writer = new WARCWriter(new AtomicInteger(),bos,target,getSettings(true, null, null, metadata)); // Write a warcinfo record with description about how this WARC // was made. writer.writeWarcinfoRecord(target.getName(), "Made from " + id + " by " + this.getClass().getName()); } private WARCWriterPoolSettings getSettings(final boolean isCompressed,
ar.addLabelValue("Filedesc", baos.toString()); List<String> metadata = new ArrayList<String>(1); metadata.add(ar.toString());
return Collections.singletonList(record.toString());