| org.apache.tapestry.ioc.Resource
All known Subclasses: org.apache.tapestry.ioc.internal.util.AbstractResource,
Resource | public interface Resource (Code) | | Represents a resource on the server that may be used for server side processing, or may be
exposed to the client side. Generally, this represents an abstraction on top of files on the
class path and files stored in the web application context.
Resources are often used as map keys; they should be immutable and should implement hashCode()
and equals().
|
Method Summary | |
Resource | forFile(String relativePath) Returns a Resource based on a relative path, relative to the folder containing the resource. | Resource | forLocale(Locale locale) Returns a localized version of the resource. | String | getFile() Returns the file portion of the Resource path, everything that follows the final forward
slash. | String | getFolder() Returns the portion of the path up to the last forward slash; this is the directory or folder
portion of the Resource. | String | getPath() Return the path (the combination of folder and file). | URL | toURL() Returns the URL for the resource, or null if it does not exist. | Resource | withExtension(String extension) Returns a new Resource with the extension changed (or, if the resource does not have an
extension, the extension is added). |
forFile | Resource forFile(String relativePath)(Code) | | Returns a Resource based on a relative path, relative to the folder containing the resource.
Understands the "." (current folder) and ".." (parent folder) conventions, and treats
multiple sequential slashes as a single slash.
|
forLocale | Resource forLocale(Locale locale)(Code) | | Returns a localized version of the resource. May return null if no such resource exists.
|
getFile | String getFile()(Code) | | Returns the file portion of the Resource path, everything that follows the final forward
slash.
|
getFolder | String getFolder()(Code) | | Returns the portion of the path up to the last forward slash; this is the directory or folder
portion of the Resource.
|
getPath | String getPath()(Code) | | Return the path (the combination of folder and file).
|
toURL | URL toURL()(Code) | | Returns the URL for the resource, or null if it does not exist.
|
withExtension | Resource withExtension(String extension)(Code) | | Returns a new Resource with the extension changed (or, if the resource does not have an
extension, the extension is added). The new Resource may not exist (that is,
Resource.toURL() may return null.
Parameters: extension - to apply to the resource, such as "html" or "properties" the new resource |
|
|