| java.lang.Object | |
| ↳ | com.atlassian.confluence.util.velocity.ConfigurableResourceManager |
Known Direct Subclasses
|
Known Indirect Subclasses
|
Class to manage the text resource for the Velocity Runtime.
This is a copy of the Velocity 1.5 org.apache.velocity.runtime.resource.ResourceManagerImpl with the following changes for Confluence:
getResource(String, int) method
getLoaderNameForResource(String) is more useful. It returns the ID of the loader rather than the class name
Ideally we would replace the entire implementation, making use of a richer resource loader interface.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ConfigurableResourceManager.ResourceFactory | Factory methods for Velocity resource objects | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | RESOURCE_CONTENT | A static content resource. | |||||||||
| int | RESOURCE_TEMPLATE | A template resources. | |||||||||
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.apache.velocity.runtime.resource.ResourceManager
| |||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| globalCache | Object implementing ResourceCache to be our resource manager's Resource cache. | ||||||||||
| log | Logging. | ||||||||||
| resourceLoaders | The List of templateLoaders that the Runtime will use to locate the InputStream source of a template. | ||||||||||
| rsvc | The internal RuntimeServices object. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Determines if a template exists, and returns name of the loader that provides it.
| |||||||||||
Gets the named resource.
| |||||||||||
This method is deprecated.
since 2.9 Use
getResource(String, int, String)
| |||||||||||
Initialize the ResourceManager.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Template method for provisioning a | |||||||||||
Loads a resource from the current set of resource loaders.
| |||||||||||
Template method to allow subclasses to post process and possibly wrap a resource loader before it is added
to the loader list.
| |||||||||||
Takes an existing resource, and 'refreshes' it.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.velocity.runtime.resource.ResourceManager
| |||||||||||
A static content resource.
A template resources.
Object implementing ResourceCache to be our resource manager's Resource cache.
Logging.
The List of templateLoaders that the Runtime will use to locate the InputStream source of a template.
The internal RuntimeServices object.
Determines if a template exists, and returns name of the loader that provides it. This is a slightly less hokey way to support the Velocity.templateExists() utility method, which was broken when per-template encoding was introduced. We can revisit this.
| resourceName | Name of template or content resource |
|---|
Gets the named resource. Returned class type corresponds to specified type (i.e. Template to
RESOURCE_TEMPLATE).
The original version of this class logs and rethrows virtually any exception thrown. This logging has been removed since these exceptions are often expected.
| resourceName | The name of the resource to retrieve. |
|---|---|
| resourceType | The type of resource (RESOURCE_TEMPLATE, RESOURCE_CONTENT, etc.). |
| encoding | The character encoding to use. |
| ResourceNotFoundException | if template not found from any available source. |
|---|---|
| ParseErrorException | if template cannot be parsed due to syntax (or other) error. |
| Exception | if a problem in parse |
This method is deprecated.
since 2.9 Use getResource(String, int, String)
Gets the named resource. Returned class type corresponds to specified type (i.e. Template to
RESOURCE_TEMPLATE).
| resourceName | The name of the resource to retrieve. |
|---|---|
| resourceType | The type of resource (RESOURCE_TEMPLATE, RESOURCE_CONTENT, etc.). |
| ResourceNotFoundException | if template not found from any available source. |
|---|---|
| ParseErrorException | if template cannot be parsed due to syntax (or other) error. |
| Exception | if a problem in parse |
Initialize the ResourceManager.
| rsvc | The Runtime Services object which is associated with this Resource Manager. |
|---|
| Exception |
|---|
Template method for provisioning a ConfigurableResourceManager.ResourceFactory. Subclasses may customise this factory where
necessary.
This implementation returns a strategy that delegates to the default Velocity resource factory methods.
Loads a resource from the current set of resource loaders.
| resourceName | The name of the resource to retrieve. |
|---|---|
| resourceType | The type of resource (RESOURCE_TEMPLATE, RESOURCE_CONTENT, etc.). |
| encoding | The character encoding to use. |
| ResourceNotFoundException | if template not found from any available source. |
|---|---|
| ParseErrorException | if template cannot be parsed due to syntax (or other) error. |
| Exception | if a problem in parse |
Template method to allow subclasses to post process and possibly wrap a resource loader before it is added to the loader list. This implementation does nothing.
| loader | Resource loader to process |
|---|---|
| properties | Configured properties for the resource loader |
Takes an existing resource, and 'refreshes' it. This generally means that the source of the resource is checked for changes according to some cache/check algorithm and if the resource changed, then the resource data is reloaded and re-parsed.
| resource | resource to refresh |
|---|---|
| encoding | character encoding of the resource to refresh. |
| ResourceNotFoundException | if template not found from current source for this Resource |
|---|---|
| ParseErrorException | if template cannot be parsed due to syntax (or other) error. |
| Exception | if a problem in parse |