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 java. handle
or NIO java., consider using FileSystemResource.
| Access | Constructor and Description |
|---|---|
| public | |
| public | FileUrlResource(String
the location (i.e. the file path within that protocol) location)Create a new |
| file | back to summary |
|---|---|
| private volatile File file
| |
| FileUrlResource | back to summary |
|---|---|
| public FileUrlResource(URL url) Create a new Note that this does not enforce "file" as URL protocol. If a protocol is known to be resolvable to a file, it is acceptable for this purpose.
| |
| FileUrlResource | back to summary |
|---|---|
| public FileUrlResource(String location) throws MalformedURLException Create a new The given parts will automatically get encoded if necessary.
| |
| createRelative | back to summary |
|---|---|
| public Resource createRelative(String relativePath) throws MalformedURLException Overrides org. Implements org. Doc from org. Create a resource relative to this resource. | |
| getFile | back to summary |
|---|---|
| public File getFile() throws IOException Overrides org. Implements org. Doc from org. Return a File handle for this resource.
| |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() throws IOException Implements org. Doc from org. Return an
| |
| isWritable | back to summary |
|---|---|
| public boolean isWritable() Overrides default org. Doc from org. Indicate whether the contents of this resource can be written
via Will be
| |
| writableChannel | back to summary |
|---|---|
| public WritableByteChannel writableChannel() throws IOException Overrides default org. Doc from org. Return a It is expected that each call creates a fresh channel. The default implementation returns
| |