How can I check whether a file exists, before opening it for reading in Java (the equivalent of Perl\'s -e $filename>
-e $filename>
Using Java 8:
if(Files.exists(Paths.get(filePathString))) { // do something }