Package org.chenile.utils.tenancy
Class TenantSpecificResourceLoader
java.lang.Object
org.chenile.utils.tenancy.TenantSpecificResourceLoader
A class that looks for a specific resource (using
tenantSpecificPath
) from the class path.
If the tenant specific resource is not found then a generic path (genericPath
is used.
The resource is then opened and the name and URL are returned by calling obtainFileName(String, String)
and obtainURL(String, String)
Variable %{name} and %{tenantId} can be used for finding the name of the resource in both the generic and tenant
specific paths.- Author:
- Raja Shankar Kolluru
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected CachedValue
obtainFileName
(String name, String tenantId) protected CachedValue
obtainValue
(String name, String tenantId) protected CachedValue
populateValue
(String filename, URL url) Override this to store cached values that have information specific to the particular sub class By default the Cached Value stores URL and filename.
-
Field Details
-
delimiter
-
tenantSpecificPath
-
genericPath
-
templateStore
-
GENERIC_TENANT_NAME
- See Also:
-
-
Constructor Details
-
TenantSpecificResourceLoader
-
-
Method Details
-
obtainURL
-
obtainFileName
-
obtainValue
-
lookup
- Throws:
Exception
-
populateValue
Override this to store cached values that have information specific to the particular sub class By default the Cached Value stores URL and filename. But the specific sub class might choose to cache additional resources.- Parameters:
filename
- the filename to look forurl
- - URL- Returns:
- the cached value
- Throws:
Exception
- if there is a problem
-