public static String filter(String input, String cmd, String... args) {
        ProcBuilder builder= new ProcBuilder(cmd)
                .withArgs(args)
                .withInput(input);


        return builder.run().getOutputString();
    }
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
@param input the input to be fed into the process
@param cmd the command
@param args the arguments
@return the standard output
@throws StartupException if the process can't be started
@throws TimeoutException if the timeout kicked in
@throws ExternalProcessFailureException if the external process returned a non-null exit value