4 ms·
> How can you ever be sure a file exists? Well I can't ever be sure, but the example I'm thinking of is looking up a config file on the file system that was co
by leothekim 8y ago
> How can you ever be sure a file exists?
Well I can't ever be sure, but the example I'm thinking of is looking up a config file on the file system that was copied there by a deployment script. If it didn't exist, a RuntimeException failing the application would be entirely appropriate.
If I was checking for a file on a USB drive or some other source, I'd very much have a try-catch. Do I need checked exceptions in this case? Still debatable in my opinion.
WRT checked exceptions targeted for production grade software, curious what you think about the (lack of) checked exception handling in Java 8 lambdas.