• S
    Treat InvalidPathException like an IOException in MockServletContext · cef4478b
    Sam Brannen 提交于
    Prior to this commit, if MockServletContext was configured with a
    FileSystemResourceLoader, invocations of the following methods on a
    Microsoft Windows operating system resulted in an InvalidPathException
    if the supplied path contained a colon (such as "C:\\temp"). This is
    inconsistent with the behavior on non-Windows operating systems. In
    addition, for comparable errors resulting in an IOException, those
    methods (except getRealPath()) return null instead of throwing the
    exception.
    
    - getResourcePaths()
    - getResource()
    - getResourceAsStream()
    - getRealPath()
    
    This commit makes handling of InvalidPathException and IOException
    consistent for these methods: both exceptions now result in null be
    returned by these methods.
    
    Closes gh-23717
    cef4478b
MockServletContextTests.java 7.9 KB