fnug.resource
Class DefaultBundleResource
java.lang.Object
fnug.resource.AbstractResource
fnug.resource.DefaultResource
fnug.resource.DefaultBundleResource
- All Implemented Interfaces:
- HasBundle, HasJSLintResult, HasLastModifiedBytes, Resource
public class DefaultBundleResource
- extends DefaultResource
- implements HasBundle, HasJSLintResult
Extension of DefaultResource
that implements HasBundle
.
- Author:
- Martin Algesten
Method Summary |
boolean |
checkModified()
Compares this resource in memory held last modified date with the one on disk (or for aggregated resource, all
the aggregates are checked). |
Bundle |
getBundle()
Returns the associated bundle. |
com.googlecode.jslint4java.JSLintResult |
getJSLintResult()
Returns the jslint result. |
DefaultBundleResource
public DefaultBundleResource(Bundle bundle,
String path)
- Constructs setting the necessary bundle and path. The
BundleConfig.basePath()
will be used as
AbstractResource.getBasePath()
. The BundleConfig.checkModifiedInterval()
will be used for check intervals of the
resource.
- Parameters:
bundle
- the bundle to construct from and which base path to use.path
- the local path. See AbstractResource.getPath()
.
getBundle
public Bundle getBundle()
- Returns the associated bundle.
- Specified by:
getBundle
in interface HasBundle
- Returns:
- the associated bundle.
getJSLintResult
public com.googlecode.jslint4java.JSLintResult getJSLintResult()
- Returns the jslint result. If the entity does not have a lint result, null is returned.
- Specified by:
getJSLintResult
in interface HasJSLintResult
checkModified
public boolean checkModified()
- Compares this resource in memory held last modified date with the one on disk (or for aggregated resource, all
the aggregates are checked). If the last modified on disk is found to be newer than the one in memory, the in
memory data is dropped and reread on next
Resource.getBytes()
or Resource.getLastModified()
.
- Specified by:
checkModified
in interface Resource
- Overrides:
checkModified
in class AbstractResource
- Returns:
- true if the file system resource (or aggregates in case of aggregated resources) has a newer last
modified date which caused the in memory held data to be dropped.
Copyright © 2012. All Rights Reserved.