001package org.unix4j.unix.xargs; 002 003import org.unix4j.line.Line; 004import org.unix4j.processor.LineProcessor; 005 006/** 007 * Output object passed to invoked commands. Forwards line output to a delegate 008 * output object but swallows the finish call as we only want to finish output 009 * after all invocations. 010 */ 011class XargsOutput implements LineProcessor { 012 013 private final LineProcessor delegate; 014 015 public XargsOutput(LineProcessor delegate) { 016 this.delegate = delegate; 017 } 018 @Override 019 public boolean processLine(Line line) { 020 return delegate.processLine(line); 021 } 022 @Override 023 public void finish() { 024 //do nothing here, forward finish call in finishAll() 025 } 026 public void finishAll() { 027 delegate.finish(); 028 } 029}