/** * A {@code StreamConsumer} providing consumed lines as a {@code String}. * * @see #getOutput() */ public static class StringStreamConsumer implements StreamConsumer { private final StringBuffer string = new StringBuffer(); private static final String LS = System.getProperty( "line.separator", "\n" ); /** * {@inheritDoc} */ @Override public void consumeLine( String line ) { string.append( line ).append( LS ); } /** * @return The output. */ public String getOutput() { return string.toString(); } }
ShutdownHookUtils.removeShutdownHook( processHook );