recordHolder = new BufferedDocumentHolder();
recordHolder.setBufferListener(new BufferAction());
recordHolder.setMaxBufferSize(maxBufferSize);
}
ResourceMetaData meta = resource.getMetaData();
String resourceDir = StringUtils.concatPath(indexDir, meta
.getResourceName().replaceAll(" ", "_"));
// Prepare the IndexWriter
try {
// warning: Current impl clear the index dir first!
initDir(resourceDir);
try {
meta.write(new FileOutputStream(StringUtils.concatPath(
resourceDir, "meta.properties")));
} catch (IOException e) {
log.error("Failed to write the meta data!", e);
return -1;
}