org.norther.tammi.spray.engine.resource
Interface ResourceResolver<T>

Type Parameters:
T - the resource type.
All Known Implementing Classes:
AbstractResourceResolver, ClassPathResourceResolver, FileResourceResolver, JarResourceResolver, PropertyResourceResolver

public interface ResourceResolver<T>

An interface to content resource resolvers.

Version:
$Id: ResourceResolver.java,v 1.8 2009/09/28 15:08:31 cvsimp Exp $
Author:
Ilkka Priha

Method Summary
 String getFinderAlias()
          Gets the name or alias of the finder to apply.
 String getFinderKey()
          Gets the finder key to apply.
 long getLastModified(String name)
          Gets a timestamp of the last modification of the resource.
 String[] getPaths()
          Gets the array of resource paths.
 Resource<T> getResource(String name)
          Gets a named resource.
 InputStream getResourceAsStream(String name)
          Gets a named resource as a stream.
 MBeanReference<? extends TemplateEngine> getTemplateEngineMBean()
          Gets a reference to the template engine.
 boolean resourceExists(String name)
          Checks whether a resource exists.
 void setFinderAlias(String alias)
          Sets the name or alias of the finder to apply.
 void setFinderKey(String key)
          Sets the finder key to apply.
 void setPaths(String[] paths)
          Sets the array of resource paths.
 void setTemplateEngineMBean(MBeanReference<? extends TemplateEngine> ref)
          Sets a reference to the template engine.
 

Method Detail

getPaths

String[] getPaths()
Gets the array of resource paths.

Returns:
the resource paths or null.

setPaths

void setPaths(String[] paths)
Sets the array of resource paths.

Parameters:
paths - the resource paths.

getFinderKey

String getFinderKey()
Gets the finder key to apply.

Returns:
the finder key or null.

setFinderKey

void setFinderKey(String key)
Sets the finder key to apply.

Parameters:
key - the finder key.

getFinderAlias

String getFinderAlias()
Gets the name or alias of the finder to apply.

Returns:
the finder alias or null.

setFinderAlias

void setFinderAlias(String alias)
Sets the name or alias of the finder to apply.

Parameters:
alias - the finder alias.

getTemplateEngineMBean

MBeanReference<? extends TemplateEngine> getTemplateEngineMBean()
Gets a reference to the template engine.

Returns:
a reference to the template engine.

setTemplateEngineMBean

void setTemplateEngineMBean(MBeanReference<? extends TemplateEngine> ref)
Sets a reference to the template engine.

Parameters:
ref - a reference to the template engine.

getResource

Resource<T> getResource(String name)
Gets a named resource.

Parameters:
name - the name of the resource.
Returns:
the named resource or null if not found.

getResourceAsStream

InputStream getResourceAsStream(String name)
                                throws IOException
Gets a named resource as a stream.

Parameters:
name - the name of the resource.
Returns:
the named resource as a stream or null if not found.
Throws:
IOException - on I/O errors.

getLastModified

long getLastModified(String name)
Gets a timestamp of the last modification of the resource.

Parameters:
name - the name of the resource.
Returns:
the modification time stamp or 0 if not found.

resourceExists

boolean resourceExists(String name)
Checks whether a resource exists.

Parameters:
name - the name of the resource.
Returns:
true if the resource exists, otherwise false.


Copyright © 2004 The Norther Organization. All rights reserved.