question: public String readScript ( String fname ) throws IOException { StringBuilder sb = new StringBuilder ( ) ; BufferedReader in = null ; try { if ( fname . startsWith ( "hdfs:" ) || fname . startsWith ( "gpfs:" ) ) { FileSystem fs = FileSystem . get ( ConfigurationManager . getCachedJobConf ( ) ) ; Path scriptPath = new Path ( fname ) ; in = new BufferedReader ( new InputStreamReader ( fs . open ( scriptPath ) ) ) ; } else { in = new BufferedReader ( new FileReader ( fname ) ) ; } String tmp = null ; while ( ( tmp = in . readLine ( ) ) != null ) { sb . append ( tmp ) ; sb . append ( "\n" ) ; } } finally { IOUtilFunctions . closeSilently ( in ) ; } return sb . toString ( ) ; }
target:  Read a DML or PyDML file as a string.