Read new data from a constantly updating file in Java

I have a log file that is constantly updated with new data rows. I need to get new added data in Java as soon as it's written. For now, my solution is:

public static void readNonStop (string filename, boolean goToEnd, FileReadCallback readCallback) {
if (readCallback == null) {
Return;
}
To attempt {
BufferedReader br = new BufferedReader (new FileReader (filename));
To attempt {
String line = br.readLine ();
int lineNumber = 0;

if (goToEnd) {
while (br.readLine ()! = null) {}
}

while (true) {
if (line! = null) {
readCallback.onRead (lineNumber ++, line);
} else {
Thread sleep (1);
}
line = br.readLine ();
}
} Finally {
br.close ();
}
} catch (exception e) {
e.printStackTrace ();
}
}

But I feel there should be a better way. I do not like the idea of ​​a constant running loop with a "sleep" and would prefer an event-driven approach.

If I rely on FileSystem events to reopen the file every time I change it, it will cause a delay.

What is the right way to do this for this situation?

Thank you in advance!