Package org.zkoss.util.resource
Class ContentLoader
- java.lang.Object
-
- org.zkoss.util.resource.AbstractLoader<java.lang.Object,java.lang.String>
-
- org.zkoss.util.resource.ContentLoader
-
- All Implemented Interfaces:
Loader<java.lang.Object,java.lang.String>
public class ContentLoader extends AbstractLoader<java.lang.Object,java.lang.String>
ALoader
that loads the resource by use URL.getContent() if the source is URL, or loads into a String if the source is a File (and assuming UTF-8).- Author:
- tomyeh
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.zkoss.util.resource.Loader
Loader.Resource<V>
-
-
Constructor Summary
Constructors Constructor Description ContentLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
load(java.lang.Object src)
Loads the resource.-
Methods inherited from class org.zkoss.util.resource.AbstractLoader
getLastModified, shallCheck
-
-
-
-
Method Detail
-
load
public java.lang.String load(java.lang.Object src) throws java.lang.Exception
Description copied from interface:Loader
Loads the resource.The returned resource could be anything. It will be returned by
ResourceCache.get(java.lang.Object)
. However, if you want to have more control (e.g., whether to cache), you can return an instance ofLoader.Resource
. Then, the return value ofResourceCache.get(java.lang.Object)
will beLoader.Resource.resource
.- Returns:
- null if not found
- Throws:
java.lang.Exception
- you might throw any exception which will be passed back to the caller ofResourceCache.get(java.lang.Object)
-
-