Class SpringResourceTemplateResource
- Object
-
- org.thymeleaf.spring3.templateresource.SpringResourceTemplateResource
-
- All Implemented Interfaces:
org.thymeleaf.templateresource.ITemplateResource
public final class SpringResourceTemplateResource extends Object implements org.thymeleaf.templateresource.ITemplateResource
Implementation of
ITemplateResource
that resolves resources by delegating on Spring's resource resolution mechanism, implemented by theResourceLoader
interface.This resource resolver accesses the Spring resource resolution mechanism by means of calls to
ResourceLoader.getResource(String)
.- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
-
Constructor Summary
Constructors Constructor Description SpringResourceTemplateResource(org.springframework.context.ApplicationContext applicationContext, String location, String characterEncoding)
SpringResourceTemplateResource(org.springframework.core.io.Resource resource, String characterEncoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists()
String
getBaseName()
String
getDescription()
Reader
reader()
org.thymeleaf.templateresource.ITemplateResource
relative(String relativeLocation)
-
-
-
Constructor Detail
-
SpringResourceTemplateResource
public SpringResourceTemplateResource(org.springframework.context.ApplicationContext applicationContext, String location, String characterEncoding)
-
SpringResourceTemplateResource
public SpringResourceTemplateResource(org.springframework.core.io.Resource resource, String characterEncoding)
-
-
Method Detail
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceorg.thymeleaf.templateresource.ITemplateResource
-
getBaseName
public String getBaseName()
- Specified by:
getBaseName
in interfaceorg.thymeleaf.templateresource.ITemplateResource
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.thymeleaf.templateresource.ITemplateResource
-
reader
public Reader reader() throws IOException
- Specified by:
reader
in interfaceorg.thymeleaf.templateresource.ITemplateResource
- Throws:
IOException
-
relative
public org.thymeleaf.templateresource.ITemplateResource relative(String relativeLocation)
- Specified by:
relative
in interfaceorg.thymeleaf.templateresource.ITemplateResource
-
-