org.norther.tammi.spray.media
Interface MediaProvider

All Known Subinterfaces:
CachedMediaProvider, ServletMediaProvider
All Known Implementing Classes:
DefaultCachedMediaProvider, DefaultMediaProvider, DefaultServletMediaProvider

public interface MediaProvider

An interface to media providers.

Author:
Ilkka Priha

Method Summary
 String getDefaultIndex()
          Gets the default index file.
 String getMediaKey()
          Gets the path finder key for resolving media paths.
 Resource getResource(String path, boolean cached, ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the media content resource.
 boolean isLocalizedContent()
          Gets the localized content flag.
 void setDefaultIndex(String index)
          Sets the default index file.
 void setLocalizedContent(boolean flag)
          Sets the localized content flag.
 void setMediaKey(String key)
          Sets the path finder key for resolving media paths.
 

Method Detail

getMediaKey

String getMediaKey()
Gets the path finder key for resolving media paths.

Returns:
the path finder key.

setMediaKey

void setMediaKey(String key)
Sets the path finder key for resolving media paths. The default key is PathFinder.MEDIA.

Parameters:
key - the path finder key.

getDefaultIndex

String getDefaultIndex()
Gets the default index file.

Returns:
the default index file.

setDefaultIndex

void setDefaultIndex(String index)
Sets the default index file.

Parameters:
index - a default index file.

isLocalizedContent

boolean isLocalizedContent()
Gets the localized content flag.

Returns:
the localized content flag.

setLocalizedContent

void setLocalizedContent(boolean flag)
Sets the localized content flag. Localized media content names are formed by inserting the locale string between the plain name and the extension.

Parameters:
flag - the localized content flag.

getResource

Resource getResource(String path,
                     boolean cached,
                     ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
                     throws IOException,
                            ConstructionException,
                            AccessDeniedException
Gets the media content resource.

Parameters:
path - the content path.
cached - true if caching is enabled, false otherwise.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the resource source.
Throws:
IOException - on I/O errors.
ConstructionException - on resource errors.
AccessDeniedException - for access restrictions.


Copyright © 2004 The Norther Organization. All rights reserved.