Is it ever favorable to create a FileInputStream, like this:
InputStream fileInputStream = new FileInputStream(resource.getFile());
instead of using the InputStream created by the resource, like this:
InputStream resourceInputStream = resource.getInputStream();
The resource is an org.springframework.core.io.Resource.
If all you need is the input stream, then there is no reason not to use it. The point of
getFileis getting access to the file in ways other than opening aFileInputStreamon it, such as reading attributes, moving, deleting, opening it through NIO instead of classic IO, etc.