Disclaimer: I have not tested this on a non-Windows platform, so it may have different results on a platform with different file locking characteristics.
If you lock the file beforehand, you can trigger an IOException when something attempts to read from it:
java.io.IOException: The process cannot access the file because another process has locked a portion of the file
This works even if you are in the same thread.
Here’s some sample code:
final RandomAccessFile raFile = new RandomAccessFile(csvFile, "rw");
raFile.getChannel().lock();