public static String readFile(Class<?> context,String name) throws IOException {
  try (InputStream in=context.getResourceAsStream(name)){
    if (in == null) {
      return null;
    }
    return new String(ByteStreams.toByteArray(in),ENC);
  }
 catch (  IOException e) {
    throw new IOException("Error reading " + name,e);
  }
}

public static String readFile ( Class < ? > context , String name ) throws IOException { try ( InputStream in = context . getResourceAsStream ( name ) ) { if ( in == null ) { return null ; } return new String ( ByteStreams . toByteArray ( in ) , ENC ) ; } catch ( IOException e ) { throw new IOException ( "Error reading " + name , e ) ; } }
read a read a utf - 8 text file from our classpath and return it .
