org.thymeleaf.resourceresolver
Class ClassLoaderResourceResolver

Object
  extended by org.thymeleaf.resourceresolver.ClassLoaderResourceResolver
All Implemented Interfaces:
IResourceResolver

public final class ClassLoaderResourceResolver
extends Object
implements IResourceResolver

Implementation of IResourceResolver that resolves resources as classloader resources:

Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceName)

Since:
1.0
Author:
Daniel Fernández

Field Summary
static String NAME
           
 
Constructor Summary
ClassLoaderResourceResolver()
           
 
Method Summary
 String getName()
           The name of the resource resolver.
 java.io.InputStream getResourceAsStream(TemplateProcessingParameters templateProcessingParameters, String resourceName)
           Resolve the resource, this is, open an input stream for it.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

ClassLoaderResourceResolver

public ClassLoaderResourceResolver()
Method Detail

getName

public String getName()
Description copied from interface: IResourceResolver

The name of the resource resolver.

Specified by:
getName in interface IResourceResolver
Returns:
the name of the resource resolver.

getResourceAsStream

public java.io.InputStream getResourceAsStream(TemplateProcessingParameters templateProcessingParameters,
                                               String resourceName)
Description copied from interface: IResourceResolver

Resolve the resource, this is, open an input stream for it.

If the resource cannot be resolved, this method should return null.

Specified by:
getResourceAsStream in interface IResourceResolver
Parameters:
templateProcessingParameters - the TemplateProcessingParameters object being used for template processing
resourceName - the resource name to be resolved/read
Returns:
an InputStream on the resource


Copyright © 2012 The THYMELEAF team. All Rights Reserved.