org.zkoss.util.resource
Class ContentLoader
java.lang.Object
org.zkoss.util.resource.AbstractLoader
org.zkoss.util.resource.ContentLoader
- All Implemented Interfaces:
- Loader
public class ContentLoader
- extends AbstractLoader
A Loader 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 assumging UTF-8).
- Author:
- tomyeh
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContentLoader
public ContentLoader()
load
public Object load(Object src)
throws 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
of Loader.Resource. Then, the return value of ResourceCache.get(java.lang.Object)
will be Loader.Resource.resource.
- Returns:
- null if not found
- Throws:
Exception - you might throw any exception which will be
passed back to the caller of ResourceCache.get(java.lang.Object)
Copyright © 2012. All Rights Reserved.