public final class UrlResourceResolver extends Object implements IResourceResolver
Implementation of IResourceResolver
that resolves
resources as URLs:
try { final URL url = new URL(resourceName); return url.openStream(); } catch (final Exception e1) { return null; }
Constructor and Description |
---|
UrlResourceResolver() |
Modifier and Type | Method and Description |
---|---|
String |
getName()
The name of the resource resolver.
|
InputStream |
getResourceAsStream(TemplateProcessingParameters templateProcessingParameters,
String resourceName)
Resolve the resource, this is, open an input stream for it.
|
public static final String NAME
public String getName()
IResourceResolver
The name of the resource resolver.
getName
in interface IResourceResolver
public InputStream getResourceAsStream(TemplateProcessingParameters templateProcessingParameters, String resourceName)
IResourceResolver
Resolve the resource, this is, open an input stream for it.
If the resource cannot be resolved, this method should return null.
getResourceAsStream
in interface IResourceResolver
templateProcessingParameters
- the TemplateProcessingParameters
object being used for template processingresourceName
- the resource name to be resolved/readCopyright © 2017 The THYMELEAF team. All rights reserved.