org.olat.core.util.filter.impl
Class AddBaseURLToMediaRelativeURLFilter

java.lang.Object
  extended by org.olat.core.util.filter.impl.AddBaseURLToMediaRelativeURLFilter
All Implemented Interfaces:
Filter

public class AddBaseURLToMediaRelativeURLFilter
extends java.lang.Object
implements Filter

Description:
This filter searches in the given HTML string for relative media urls that point to media files and adds the given mapper base path to this URL to deliver the media files with absolute URLs.

Example:
<img src="media/myimage.jpg" />

This will be converted to:
<img src="http://your.olat.com/olat/m/12345/media/myimage.jpg" />

The resulting string can be embedded into any HTML page and the media files will be loaded from the mapper base path.

Initial Date: 16.07.2009

Author:
gnaegi

Constructor Summary
AddBaseURLToMediaRelativeURLFilter(java.lang.String mapperBaseURL)
          Constructor
 
Method Summary
 java.lang.String filter(java.lang.String original)
          Filter the original value and return the result.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddBaseURLToMediaRelativeURLFilter

public AddBaseURLToMediaRelativeURLFilter(java.lang.String mapperBaseURL)
Constructor

Parameters:
mapperBaseURL - The mapper base url that is used in this filter as a prefix for relative media URL
Method Detail

filter

public java.lang.String filter(java.lang.String original)
Description copied from interface: Filter
Filter the original value and return the result. If the original value is NULL, the filter method will return NULL

Specified by:
filter in interface Filter
Returns:
See Also:
Filter.filter(java.lang.String)