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 Link icon

  • Constructor Details Link icon

    • PreloadClientCacheResource Link icon

      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 Link icon

    • getOwner Link icon

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

      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 Link icon

      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 Link icon

      public abstract long getSize()
      Returns the size of the resource in bytes.
      Returns:
      The size, or -1 if resource is not found.
    • getModificationTime Link icon

      public abstract long getModificationTime()
      Returns the modification time of the resource.
      Returns:
      The modification time, or zero if resource is not found.