org.norther.tammi.spray.media.tool
Class MediaTool

java.lang.Object
  extended by org.norther.tammi.core.pool.RecyclableSupport
      extended by org.norther.tammi.core.pool.PoolableSupport
          extended by org.norther.tammi.spray.engine.tool.GlobalTool
              extended by org.norther.tammi.spray.engine.tool.ContextTool
                  extended by org.norther.tammi.spray.media.tool.MediaTool
All Implemented Interfaces:
Serializable, Cloneable, EventListener, Poolable, Recyclable, ContextBindingListener
Direct Known Subclasses:
LinkTool, SkinTool

public class MediaTool
extends ContextTool

A request context tool supporting creation of links to hosts and services.

Version:
$Id: MediaTool.java,v 1.17 2010-03-30 16:01:28 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
MediaTool()
          Constructs a new content.
 
Method Summary
 String toMediaFile(String type, int... index)
          Returns a virtual media file.
 String toURL(String path)
          Returns a URL pointing to the specified media content.
 String toURL(String path, boolean localized)
          Returns a URL pointing to the localized media content if the localized flag is set.
 
Methods inherited from class org.norther.tammi.spray.engine.tool.ContextTool
dispose, getFilter, getFilterChain, getFilterKey, getPrincipal, getRequest, getResponse, isFilterChanged
 
Methods inherited from class org.norther.tammi.spray.engine.tool.GlobalTool
clone, getContext, getContextToolFilter, getMBeanServer, isBound, nop, toString, valueBound, valueUnbound
 
Methods inherited from class org.norther.tammi.core.pool.PoolableSupport
disposed, recycled
 
Methods inherited from class org.norther.tammi.core.pool.RecyclableSupport
isDisposed, recycle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.pool.Recyclable
isDisposed, recycle
 

Constructor Detail

MediaTool

public MediaTool()
Constructs a new content.

Method Detail

toURL

public String toURL(String path)
Returns a URL pointing to the specified media content.

Parameters:
path - a path to the content.
Returns:
the media content URL.

toURL

public String toURL(String path,
                    boolean localized)
Returns a URL pointing to the localized media content if the localized flag is set. Otherwise the content is supposed to be non-localized.

Note that search for localized URLs is available only if the content filter is configured to support localized content.

Parameters:
path - a path to the content.
localized - true for localized, false otherwise.
Returns:
the media content URL.

toMediaFile

public String toMediaFile(String type,
                          int... index)
Returns a virtual media file.

Parameters:
type - the content type.
index - an optional index.
Returns:
the virtual file.


Copyright © 2004 The Norther Organization. All rights reserved.