Class FileUrlResource

All Implemented Interfaces:
InputStreamSource, Resource, WritableResource

public class FileUrlResource extends UrlResource implements WritableResource
Subclass of UrlResource which assumes file resolution, to the degree of implementing the WritableResource interface for it. This resource variant also caches resolved File handles from getFile().

This is the class resolved by DefaultResourceLoader for a "file:..." URL location, allowing a downcast to WritableResource for it.

Alternatively, for direct construction from a File handle or NIO Path, consider using FileSystemResource.

Juergen Hoeller