Package com.iizix.prop
Class PreloadClientCacheResource<PROP extends GProp<?>>
java.lang.Object
com.iizix.prop.PreloadClientCacheResource<PROP>
- Direct Known Subclasses:
CSSResourceFilePreload,FontFilePreloadClientCacheResource
Class holding information for a single resource that should be preloaded to the client cache when the application starts.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PreloadClientCacheResource[]An empty array of resources.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionabstract longReturns the modification time of the resource.final PROPgetOwner()Gets the owner property.final StringgetPath()Gets the path to the resource used for the client side.abstract longgetSize()Returns the size of the resource in bytes.booleanisRelevant(IClientSessionGyro clientGyro) Verifies if this resource is of relevant use for the client.
Field Details
EMPTY
An empty array of resources.
Constructor Details
PreloadClientCacheResource
Constructs the resource.- Parameters:
owner- The owner property.path- The resource path for the client as "module$/path/filename.ext".
Method Details
getOwner
Gets the owner property.- Returns:
- The property containing the asset reference.
getPath
Gets the path to the resource used for the client side.- Returns:
- The relative path of the resource in the form of "module$/path/filename.ext".
isRelevant
Verifies if this resource is of relevant use for the client. This call makes it possible to verify the client browser or alike to check if a resource is needed (e.g. a font icon resource of WOFF2 may only be required in particular cases, whereas the WOFF type may be required for the other clients).- Parameters:
clientGyro- The client gyro instance, initialized with client side information.- Returns:
- true If the resource is relevant, false otherwise. The default is to return true.
getSize
public abstract long getSize()Returns the size of the resource in bytes.- Returns:
- The size, or -1 if resource is not found.
getModificationTime
public abstract long getModificationTime()Returns the modification time of the resource.- Returns:
- The modification time, or zero if resource is not found.