Resource implementation for java.io.File and
java.nio.file.Path handles with a file system target.
Supports resolution as a File and also as a URL.
Implements the extended WritableResource interface.
Note: As of Spring Framework 5.0, this Resource implementation uses
NIO.2 API for read/write interactions. As of 5.1, it may be constructed with a
Path handle in which case it will perform all file system
interactions via NIO.2, only resorting to File on getFile().
Note: When building relative resources via createRelative(java.lang.String),
it makes a difference whether the specified resource base path here
ends with a slash or not. In the case of "C:/dir1/", relative paths
will be built underneath that root: e.g. relative path "dir2" ->
"C:/dir1/dir2". In the case of "C:/dir1", relative paths will apply
at the same directory level: relative path "dir2" -> "C:/dir2".
Create a new FileSystemResource from a File handle.
Note: When building relative resources via createRelative(java.lang.String),
the relative path will apply at the same directory level:
e.g. new File("C:/dir1"), relative path "dir2" -> "C:/dir2"!
If you prefer to have relative paths built underneath the given root
directory, use the constructor with a file path
to append a trailing slash to the root path: "C:/dir1/", which
indicates this directory as root for all relative paths.