public static Object readJsonInput ( File file , boolean suppressOutput ) { Object jsonObject ; if ( file == null ) { try { jsonObject = JsonUtils . jsonToMap ( System . in ) ; } catch ( Exception e ) { printToStandardOut ( "Failed to process standard input." , suppressOutput ) ; return null ; } } else { jsonObject = createJsonObjectFromFile ( file , suppressOutput ) ; } return jsonObject ; }
This method will read in JSON either from the given file or from standard in if the file is null . An object contain the ingested input is returned .