public class CacheProvider extends Object
Resource
s. Resources should be cached by calling
Resources.dumpToCache(org.appng.api.model.ResourceType...)
.
The application cache may be used by applications and provides a location in the file system where instance-specific
files can be cached. These are usually artifacts which are based on some source data stored in a database.
The cache is not a persistent data storage and must not be used for unrecoverable data.Constructor and Description |
---|
CacheProvider(Properties platformConfig)
Creates a new CacheProvider.
|
CacheProvider(Properties platformConfig,
boolean changeOwner)
Creates a new CacheProvider.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache(Site site)
Clears both the platform cache and the application cache for the given site.
|
void |
clearCache(Site site,
String application)
Clears both the platform cache and the application cache for the specified application of the specified site.
|
protected File |
getApplicationCache()
Returns the root directory of the application cache.
|
protected File |
getApplicationCache(Nameable site)
Returns the root application cache directory for a site.
|
protected File |
getApplicationCache(Nameable site,
Nameable application)
Returns the root application cache directory for an application.
|
protected File |
getApplicationCache(String site)
Returns the root application cache directory for a site.
|
protected File |
getApplicationCache(String site,
String application)
Returns the root application cache directory for an application.
|
protected File |
getCache()
Returns the overall cache root directory.
|
File |
getImageCache(Nameable site,
Nameable application)
Returns the root image cache directory for an application.
|
protected File |
getImageCache(String site,
String application)
Returns the root image cache directory for an application.
|
protected File |
getPlatformCache()
Returns the root directory of the platform cache.
|
protected File |
getPlatformCache(Nameable site)
Returns the root platform cache directory for a site.
|
File |
getPlatformCache(Nameable site,
Nameable application)
Returns the root platform cache directory for an application.
|
protected File |
getPlatformCache(String site)
Returns the root platform cache directory for a site.
|
protected File |
getPlatformCache(String site,
String application)
Returns the root platform cache directory for an application.
|
String |
getRelativePlatformCache(Nameable site,
Nameable application)
Returns the relative platform cache directory for an application.
|
public CacheProvider(Properties platformConfig)
platformConfig
- The platform configuration. Contains values for keys defined in
Platform.Property
.public CacheProvider(Properties platformConfig, boolean changeOwner)
platformConfig
- The platform configuration. Contains values for keys defined in
Platform.Property
.changeOwner
- if set to true
and we're running on *nix, a recursive chown
command is being executed
for the cache folderpublic void clearCache(Site site)
site
- The site which caches are cleared.public void clearCache(Site site, String application)
site
- application
- The application which caches are cleared. The application must be assigned to the aforementioned site.
The caches of the same application assigned to other sites will not be cleared.protected File getCache()
protected File getPlatformCache()
protected File getPlatformCache(Nameable site)
site
- protected File getPlatformCache(String site)
site
- public File getPlatformCache(Nameable site, Nameable application)
site
- application
- protected File getPlatformCache(String site, String application)
site
- application
- public String getRelativePlatformCache(Nameable site, Nameable application)
site
- application
- protected File getApplicationCache()
protected File getApplicationCache(Nameable site)
site
- protected File getApplicationCache(String site)
site
- protected File getApplicationCache(Nameable site, Nameable application)
site
- application
- protected File getApplicationCache(String site, String application)
site
- application
- public File getImageCache(Nameable site, Nameable application)
site
- application
- protected File getImageCache(String site, String application)
site
- application
- Copyright © 2011–2018 aiticon GmbH. All rights reserved.