|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.groovy.grails.io.support.AbstractFileResolvingResource
public abstract class AbstractFileResolvingResource
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.
| Constructor Summary | |
|---|---|
AbstractFileResolvingResource()
|
|
| Method Summary | |
|---|---|
long |
contentLength()
Determine the content length for this resource. |
boolean |
exists()
Return whether this resource actually exists in physical form. |
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). |
boolean |
isReadable()
Return whether the contents of this resource can be read, e.g. |
long |
lastModified()
Determine the last-modified timestamp for this resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.codehaus.groovy.grails.io.support.Resource |
|---|
createRelative, getDescription, getFilename, getInputStream, getURI, getURL |
| Constructor Detail |
|---|
public AbstractFileResolvingResource()
| Method Detail |
|---|
public java.io.File getFile()
throws java.io.IOException
getFile in interface Resourcejava.io.IOException - if the resource cannot be resolved as absolute
file path, i.e. if the resource is not available in a file system
protected java.io.File getFileForLastModifiedCheck()
throws java.io.IOException
java.io.IOException
protected java.io.File getFile(java.net.URI uri)
throws java.io.IOException
java.io.IOExceptionpublic boolean exists()
ResourceThis method performs a definitive existence check, whereas the
existence of a Resource handle only guarantees a
valid descriptor handle.
exists in interface Resourcepublic boolean isReadable()
ResourceResource.getInputStream() or Resource.getFile().
Will be true for typical resource descriptors;
note that actual content reading may still fail when attempted.
However, a value of false is a definitive indication
that the resource content cannot be read.
isReadable in interface ResourceResource.getInputStream()
public long contentLength()
throws java.io.IOException
Resource
contentLength in interface Resourcejava.io.IOException - if the resource cannot be resolved
(in the file system or as some other known physical resource type)
public long lastModified()
throws java.io.IOException
Resource
lastModified in interface Resourcejava.io.IOException - if the resource cannot be resolved
(in the file system or as some other known physical resource type)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||