Retrieving the underlying error when File.listFiles return null

Viewed 8014

According to the File.listFiles javadoc the method

Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.

I know that I am using a directory, but have received a null result, so an I/O error must've appeared. I'm very much interested in what the error was.

How can I retrieve the error message/code when such a null result is returned?

4 Answers
Related