org.jasig.portlet.cms.service
Class AntiSamyStringCleaningService

java.lang.Object
  extended by org.jasig.portlet.cms.service.AntiSamyStringCleaningService
All Implemented Interfaces:
IStringCleaningService, InitializingBean

@Component
public class AntiSamyStringCleaningService
extends Object
implements IStringCleaningService, InitializingBean

AntiSamyStringCleaningService provides an implementation of the IStringCleaningService interface that uses OWASP's AntiSamy tool to perform HTML string cleaning. This implementation's behavior is controlled by a configured policy file.

Version:
$Revision: 20672 $
Author:
Jen Bourey, jbourey@unicon.net

Constructor Summary
AntiSamyStringCleaningService()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  org.owasp.validator.html.AntiSamy getAntiSamyInstance()
          Just returns a new AntiSamy instance.
 String getSafeContent(String content)
          Return a safe HTML string version of the provided content.
 void setResource(Resource resource)
          Set the resource to be used as the AntiSamy policy file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntiSamyStringCleaningService

public AntiSamyStringCleaningService()
Method Detail

setResource

public void setResource(Resource resource)
Set the resource to be used as the AntiSamy policy file.

Parameters:
resource -

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getSafeContent

public String getSafeContent(String content)
Description copied from interface: IStringCleaningService
Return a safe HTML string version of the provided content.

Specified by:
getSafeContent in interface IStringCleaningService
Returns:

getAntiSamyInstance

protected org.owasp.validator.html.AntiSamy getAntiSamyInstance()
Just returns a new AntiSamy instance. This method is mostly to help enable unit tests.

Returns:
new AntiSamy instance


Copyright © 2010 Jasig. All Rights Reserved.