Class PreloadClientCacheResource

java.lang.Object
com.iizix.prop.PreloadClientCacheResource
Direct Known Subclasses:
CSSResourceFilePreload, FontFilePreloadClientCacheResource

public abstract class PreloadClientCacheResource extends Object
Class holding information for a single resource that should be preloaded to the client cache when the application starts.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • PreloadClientCacheResource

      public PreloadClientCacheResource(PropCnr owner, String path)
      Constructs the resource.
      Parameters:
      owner - The owner property.
      path - The resource path for the client as "module$/path/filename.ext".
  • Method Details

    • getOwner

      public PropCnr getOwner()
      Gets the owner property.
      Returns:
      The property containing the asset reference.
    • getPath

      public String 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

      public boolean isRelevant(IClientSessionGyro clientGyro)
      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.