26707 .Tomcat's StandardContext.getRealPath(String path) will return non null value when the file actually not exists.So add some code in ServletContextResource to check file is actually exists with jdk's File class.

Comment From: drgnchan

There is already an exists() method, do you think it is correct to check the existence of the file in the isFile() method?

maybe it is a directory.

Comment From: bclozel

Closing this PR in favor of #26707 - your contribution has been merged in b71e686cbd, but this outdated PR got wrongly updated with lots of duplicate commits (a rebase and a force-push without any merge would have made things better).

Sorry it took us so long to process this PR, this fix is going to be shipped with the next 5.3.x maintenance release.