Ideally when you read the file you should get the last stored version of that file.
Like in windows when multiple users use a shared file, sometime it warns, ‘user A’ has open the file for writing, do you want to open it in read only mode, and you can open it in read only mode & you see last stored version.
I am not sure why Java will behave differently.