I was referring to the fact of reverting to r.getFile(). Resource is an abstraction over an InputStream, and this is all you need here.