@NotNull public static String readFile(@NotNull VirtualFile file) throws IOException {
  final int ATTEMPTS=3;
  for (int attempt=0; attempt < ATTEMPTS; attempt++) {
    try {
      return new String(file.contentsToByteArray());
    }
 catch (    IOException e) {
      LOG.info(String.format("IOException while reading %s (attempt #%s)",file,attempt));
      if (attempt >= ATTEMPTS - 1) {
        throw e;
      }
    }
  }
  throw new AssertionError("Shouldn't get here. Couldn't read " + file);
}

@ NotNull public static String readFile ( @ NotNull VirtualFile file ) throws IOException { final int ATTEMPTS = 3 ; for ( int attempt = 0 ; attempt < ATTEMPTS ; attempt ++ ) { try { return new String ( file . contentsToByteArray ( ) ) ; } catch ( IOException e ) { LOG . info ( String . format ( "IOException while reading %s (attempt #%s)" , file , attempt ) ) ; if ( attempt >= ATTEMPTS - 1 ) { throw e ; } } } throw new AssertionError ( "Shouldn't get here. Couldn't read " + file ) ; }
makes 3 attempts to get the contents of the file . if all 3 fail with an ioexception , rethrows the exception .
