SpringSource/spring-framework — pull request #295 by marschall (2013-05-30 18:05:41+00:00)
Title: SPR-10608 Add Path based resource

`FileSystemResource` uses the "old" `java.io.File` instead of the "new"
`java.nio.file.Path`. One of the disadvantages is that it only works with
the default file system and not with custom ones. Since the minimum
requirement is still Java 6 `FileSystemResource` can't be retrofitted
(and no `#getPath` can be added to `Resource`).

* add `FileSystemPathResource`
* add `FileSystemPathResourceTests`
* update `Resource` with a reference to `FileSystemPathResource`

`FileSystemPathResource` delegates to the underlying file system instead
of `StringUtils` like `FileSystemResource`. It has therefore slightly
different semantics. First when building relative resources via
`#createRelative` the relative path will apply to this path (like URL or
Unix). If the same switchable behavior like `FileSystemResource` is
wanted that could be done with a boolean switch. Second equality is
delegated to the underlying file system provider so it's
case-insensitive on Windows.

`FileSystemPathResourceTests` contains `FileSystemPathResourceTests` only
minimal tests (`FileSystemResource` has no tests) as writing tests for
file code is tricky. I could write more elaborate tests using
https://github.com/marschall/memoryfilesystem if that's wanted and OK.

I did sign the Spring CLA

Issue: SPR-10608