public abstract class AbstractFileResolvingResource extends java.lang.Object implements org.springframework.core.io.Resource
Abstract base class for resources which resolve URLs into File references,
such as org.springframework.core.io.UrlResource or org.springframework.core.io.ClassPathResource.
Detects the "file" protocol as well as the JBoss "vfs" protocol in URLs, resolving file system references accordingly.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public long |
contentLength() |
|
public boolean |
exists() |
|
public java.io.File |
getFile()This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system. |
|
protected java.io.File |
getFile(java.net.URI uri)This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system. |
|
protected java.io.File |
getFileForLastModifiedCheck()This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip). |
|
public boolean |
isReadable() |
|
public long |
lastModified() |
|
private static void |
useCachesIfNecessary(java.net.URLConnection con)Set the java.net.URLConnection#setUseCaches flag on the given connection, preferring false but leaving the
flag at true for JNLP based resources. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).
Set the java.net.URLConnection#setUseCaches flag on the
given connection, preferring false but leaving the
flag at true for JNLP based resources.
con - the URLConnection to set the flag on