public interface Resource
org.springframework.core.io.Resource.| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Return whether this resource actually exists in physical form.
|
String |
getDescription()
Return a description for this resource,
to be used for error output when working with the resource.
|
File |
getFile()
Return a File handle for this resource.
|
InputStream |
getInputStream()
Return an
InputStream. |
URI |
getURI()
Return a URI handle for this resource.
|
URL |
getURL()
Return a URL handle for this resource.
|
long |
lastModified()
Determine the last-modified timestamp for this resource.
|
@Nonnull InputStream getInputStream()
InputStream.
It is expected that each call creates a fresh stream.
null)IoRuntimeException - if the stream could not be openedboolean exists()
This method performs a definitive existence check, whereas the
existence of a Resource handle only guarantees a
valid descriptor handle.
@Nonnull URL getURL()
IoRuntimeException - if the resource cannot be resolved as URL,
i.e. if the resource is not available as descriptor@Nonnull URI getURI()
IoRuntimeException - if the resource cannot be resolved as URI,
i.e. if the resource is not available as descriptor@Nonnull File getFile()
IoRuntimeException - if the resource cannot be resolved as absolute
file path, i.e. if the resource is not available in a file systemlong lastModified()
IoRuntimeException - if the resource cannot be resolved
(in the file system or as some other known physical resource type)String getDescription()
Implementations are also encouraged to return this value
from their toString method.
Object.toString()Copyright © 2017. All Rights Reserved.