validateArguments();
}
@Override
protected boolean doProcess(Record inputRecord, InputStream stream) throws IOException {
Record template = inputRecord.copy();
removeAttachments(template);
template.removeAll(Fields.MESSAGE);
Charset detectedCharset = detectCharset(inputRecord, charset);
Reader reader = new InputStreamReader(stream, detectedCharset);
BufferedReader lineReader = new BufferedReader(reader, getBufferSize(stream));
boolean isFirst = true;
String line;
while ((line = lineReader.readLine()) != null) {
if (isFirst && ignoreFirstLine) {
isFirst = false;
continue; // ignore first line
}
if (line.length() == 0) {
continue; // ignore empty lines
}
if (commentPrefix != null && line.startsWith(commentPrefix)) {
continue; // ignore comments
}
Record outputRecord = template.copy();
outputRecord.put(Fields.MESSAGE, line);
incrementNumRecords();
// pass record to next command in chain:
if (!getChild().process(outputRecord)) {
return false;