@NutDaoService public class WebappNutDao extends PathNutDao implements ServletContextHandler
A NutDao
implementation for webapp accesses.
If the war exploded, then path could be retrieved with file system access through FilePath
.
However, if the packaged war is used, then we have a more limited access to files. For instance, time stamp is not
available on the file so we will always return '-1' for polling.
AbstractNutDao.VersionNumberStrategy, AbstractNutDao.WithRootPathNutDao
PollingScheduler.Polling
NutDao.PathFormat
Constructor and Description |
---|
WebappNutDao(String base,
String[] proxies,
int pollingSeconds,
Boolean regex,
Boolean wildcard,
Boolean contentBasedVersionNumber,
Boolean computeVersionAsynchronously,
String fixedVersionNumber)
Builds a new instance with a base directory.
|
Modifier and Type | Method and Description |
---|---|
protected DirectoryPath |
createBaseDirectory()
Creates the
DirectoryPath associated to the AbstractNutDao.basePath . |
void |
setServletContext(ServletContext context)
Sets the servlet context.
|
protected List<String> |
skipStartsWith()
Gets the beginning of path to be skipped during research.
|
accessFor, exists, getLastUpdateTimestampFor, getRegularExpression, getWildcardExpression, listNutsPaths, newInputStream, save, saveSupported, toString
absolutePathOf, computeRealPaths, create, create, getBasePath, getProxyUris, getVersionNumber, getVersionNumberStrategy, proxyUriFor, run, shutdown, withRootPath
getNutObservers, getPollingInterval, observe, setPollingInterval
@ConfigConstructor public WebappNutDao(@StringConfigParam(defaultValue="/WEB-INF",propertyKey="c.g.wuic.dao.basePath") String base, @ObjectConfigParam(defaultValue="",propertyKey="c.g.wuic.dao.proxyUris",setter=ProxyUrisPropertySetter.class) String[] proxies, @IntegerConfigParam(defaultValue=-1,propertyKey="c.g.wuic.dao.pollingInterval") int pollingSeconds, @BooleanConfigParam(defaultValue=false,propertyKey="c.g.wuic.dao.regex") Boolean regex, @BooleanConfigParam(defaultValue=false,propertyKey="c.g.wuic.dao.wildcard") Boolean wildcard, @BooleanConfigParam(defaultValue=false,propertyKey="c.g.wuic.dao.contentBasedVersionNumber") Boolean contentBasedVersionNumber, @BooleanConfigParam(defaultValue=true,propertyKey="c.g.wuic.computeVersionAsynchronously") Boolean computeVersionAsynchronously, @StringConfigParam(defaultValue="",propertyKey="c.g.wuic.fixedVersionNumber") String fixedVersionNumber)
Builds a new instance with a base directory.
base
- the directory where we have to look uppollingSeconds
- the interval for polling operations in seconds (-1 to deactivate)proxies
- the proxies URIs in front of the nutregex
- if the path should be considered as a regex or notwildcard
- if the path should be considered as a wildcard or notcontentBasedVersionNumber
- true
if version number is computed from nut content, false
if based on timestampcomputeVersionAsynchronously
- (@code true} if version number can be computed asynchronously, false
otherwisefixedVersionNumber
- fixed version number, null
if version number is computed from content or is last modification dateprotected List<String> skipStartsWith()
Gets the beginning of path to be skipped during research. Should be overridden by subclass.
skipStartsWith
in class PathNutDao
protected DirectoryPath createBaseDirectory() throws IOException
Creates the DirectoryPath
associated to the AbstractNutDao.basePath
.
createBaseDirectory
in class PathNutDao
DirectoryPath
IOException
- if any I/O error occurspublic void setServletContext(ServletContext context)
Sets the servlet context.
setServletContext
in interface ServletContextHandler
context
- the servlet contextCopyright © 2012-2015. All Rights Reserved.