public void waitFor(int state) throws IOException, InterruptedException {
  while (!file.exists() || (get() != state)) {
    Thread.sleep(pollRate);
  }
}

public void waitFor ( int state ) throws IOException , InterruptedException { while ( ! file . exists ( ) || ( get ( ) != state ) ) { Thread . sleep ( pollRate ) ; } }
blocks until the state becomes the specified value .
