fnug.resource
Class AbstractAggregatedResource
java.lang.Object
fnug.resource.AbstractResource
fnug.resource.AbstractAggregatedResource
- All Implemented Interfaces:
- AggregatedResource, HasLastModifiedBytes, Resource
- Direct Known Subclasses:
- DefaultResourceCollection
public abstract class AbstractAggregatedResource
- extends AbstractResource
- implements AggregatedResource
Abstract superclass for aggregated resources.
- Author:
- Martin Algesten
Methods inherited from class fnug.resource.AbstractResource |
contentTypeForPath, ensureReadEntry, getBasePath, getBytes, getContentType, getFullPath, getLastModified, getPath, isCss, isJs, toString |
AbstractAggregatedResource
protected AbstractAggregatedResource(Bundle owner,
String path)
- Constructs setting necessary fields.
- Parameters:
owner
- The bundle owning this aggregated resource.path
- The path of the resource. See AbstractResource.getPath()
.
readEntry
protected final AbstractResource.Entry readEntry()
- Implements the abstract readEntry(), and uses
readLastModified()
and buildAggregate()
to build
the AbstractResource.Entry
.
- Specified by:
readEntry
in class AbstractResource
- Returns:
- the bytes and last modified date.
buildAggregate
protected abstract byte[] buildAggregate()
- Must be implemented in subclasses to build the aggregated bytes.
- Returns:
- the aggregated bytes, built from
AggregatedResource.getAggregates()
.
readLastModified
protected long readLastModified()
- Loops over
AggregatedResource.getAggregates()
and AggregatedResource.getDependencies()
to find the most recent last modified date.
- Specified by:
readLastModified
in class AbstractResource
- Returns:
- the most recent last modified date.
checkModified
public boolean checkModified()
- Calls
Resource.checkModified()
on all the underlying resources in AggregatedResource.getAggregates()
and
AggregatedResource.getDependencies()
. After that calls super class checkModified() which may trigger a rebuild of the
aggregate (via readEntry()
, buildAggregate()
)
- Specified by:
checkModified
in interface Resource
- Overrides:
checkModified
in class AbstractResource
- Returns:
- true if any of the resources were found to be newer.
findRequiresTags
public List<String> findRequiresTags()
- Always throws
UnsupportedOperationException
.
- Specified by:
findRequiresTags
in interface Resource
- Returns:
- The list of parsed resources found in the file.
Copyright © 2012. All Rights Reserved.