public static String filter ( String input , String cmd , String ... args ) { ProcBuilder builder = new ProcBuilder ( cmd ) . withArgs ( args ) . withInput ( input ) ; return builder . run ( ) . getOutputString ( ) ; }
Static helper to filter a string through a process