How can I check whether a file exists, before opening it for reading in Java (the equivalent of Perl\'s -e $filename>
-e $filename>
You can use the following: File.exists()
File.exists()