Package org.zkoss.web.util.resource
Class ResourceLoader<V>
- java.lang.Object
-
- org.zkoss.web.util.resource.ResourceLoader<V>
-
- All Implemented Interfaces:
org.zkoss.util.resource.Loader<org.zkoss.web.util.resource.ResourceInfo,V>
public abstract class ResourceLoader<V> extends java.lang.Object implements org.zkoss.util.resource.Loader<org.zkoss.web.util.resource.ResourceInfo,V>A semi-implemented loader to used withResourceCaches.get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object)to retrieve servlet resources.- Author:
- tomyeh
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResourceLoader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longgetLastModified(org.zkoss.web.util.resource.ResourceInfo src)Vload(org.zkoss.web.util.resource.ResourceInfo src)protected abstract Vparse(java.lang.String path, java.io.File file, java.lang.Object extra)Parses the specified file and returns the result which will be stored into the cache (ResourceCaches.get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object)).protected abstract Vparse(java.lang.String path, java.net.URL url, java.lang.Object extra)Parses the specified URL and returns the result which will be stored into the cache (ResourceCaches.get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object)).booleanshallCheck(org.zkoss.web.util.resource.ResourceInfo src, long expiredMillis)
-
-
-
Method Detail
-
parse
protected abstract V parse(java.lang.String path, java.io.File file, java.lang.Object extra) throws java.lang.Exception
Parses the specified file and returns the result which will be stored into the cache (ResourceCaches.get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object)).Deriving must override this method.
- Parameters:
extra- the extra parameter passed fromResourceCaches.get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object).- Throws:
java.lang.Exception
-
parse
protected abstract V parse(java.lang.String path, java.net.URL url, java.lang.Object extra) throws java.lang.Exception
Parses the specified URL and returns the result which will be stored into the cache (ResourceCaches.get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object)).Deriving must override this method.
- Parameters:
extra- the extra parameter passed fromResourceCaches.get(org.zkoss.web.util.resource.ResourceCache<V>, jakarta.servlet.ServletContext, java.lang.String, java.lang.Object).- Throws:
java.lang.Exception
-
shallCheck
public boolean shallCheck(org.zkoss.web.util.resource.ResourceInfo src, long expiredMillis)- Specified by:
shallCheckin interfaceorg.zkoss.util.resource.Loader<org.zkoss.web.util.resource.ResourceInfo,V>
-
getLastModified
public long getLastModified(org.zkoss.web.util.resource.ResourceInfo src)
- Specified by:
getLastModifiedin interfaceorg.zkoss.util.resource.Loader<org.zkoss.web.util.resource.ResourceInfo,V>
-
-