Liferay 7.0-ce-b4

com.liferay.portal.kernel.sanitizer
Class BaseSanitizer

java.lang.Object
  extended by com.liferay.portal.kernel.sanitizer.BaseSanitizer
All Implemented Interfaces:
Sanitizer

public abstract class BaseSanitizer
extends Object
implements Sanitizer


Field Summary
 
Fields inherited from interface com.liferay.portal.kernel.sanitizer.Sanitizer
MODE_ALL, MODE_BAD_WORDS, MODE_XSS
 
Constructor Summary
BaseSanitizer()
           
 
Method Summary
 byte[] sanitize(long companyId, long groupId, long userId, String className, long classPK, String contentType, String[] modes, byte[] bytes, Map<String,Object> options)
          Returns the sanitized content as a byte array.
 void sanitize(long companyId, long groupId, long userId, String className, long classPK, String contentType, String[] modes, InputStream inputStream, OutputStream outputStream, Map<String,Object> options)
          Sanitizes the input stream content, assigning the results to the output stream.
abstract  String sanitize(long companyId, long groupId, long userId, String className, long classPK, String contentType, String[] modes, String content, Map<String,Object> options)
          Returns the sanitized content as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseSanitizer

public BaseSanitizer()
Method Detail

sanitize

public byte[] sanitize(long companyId,
                       long groupId,
                       long userId,
                       String className,
                       long classPK,
                       String contentType,
                       String[] modes,
                       byte[] bytes,
                       Map<String,Object> options)
                throws SanitizerException
Description copied from interface: Sanitizer
Returns the sanitized content as a byte array. Implementations may modify the input byte array.

Specified by:
sanitize in interface Sanitizer
Parameters:
companyId - the primary key of the portal instance
groupId - the primary key of the site's group
userId - the user who changed the content
className - the class name of the content model implementation
classPK - the primary key of the content to sanitize, 0 if not available
contentType - the content type. For more information, see ContentTypes.
modes - ways in which to run the sanitizer, such as Sanitizer.MODE_ALL, Sanitizer.MODE_BAD_WORDS, and/or Sanitizer.MODE_XSS
bytes - the content to be sanitized
options - a map of options for the sanitizer
Returns:
the sanitized content
Throws:
SanitizerException - if a sanitizer exception occurred

sanitize

public void sanitize(long companyId,
                     long groupId,
                     long userId,
                     String className,
                     long classPK,
                     String contentType,
                     String[] modes,
                     InputStream inputStream,
                     OutputStream outputStream,
                     Map<String,Object> options)
              throws SanitizerException
Description copied from interface: Sanitizer
Sanitizes the input stream content, assigning the results to the output stream.

Specified by:
sanitize in interface Sanitizer
Parameters:
companyId - the primary key of the portal instance
groupId - the primary key of the site's group
userId - the user who changed the content
className - the class name of the content model implementation
classPK - the primary key of the content to sanitize, 0 if not available
contentType - the content type. For more information, see ContentTypes.
modes - ways in which to run the sanitizer, such as Sanitizer.MODE_ALL, Sanitizer.MODE_BAD_WORDS, and/or Sanitizer.MODE_XSS
inputStream - the content to be sanitized
outputStream - the result of the sanitizing process
options - a map of options for the sanitizer
Throws:
SanitizerException - if a sanitizer exception occurred

sanitize

public abstract String sanitize(long companyId,
                                long groupId,
                                long userId,
                                String className,
                                long classPK,
                                String contentType,
                                String[] modes,
                                String content,
                                Map<String,Object> options)
                         throws SanitizerException
Description copied from interface: Sanitizer
Returns the sanitized content as a string.

Specified by:
sanitize in interface Sanitizer
Parameters:
companyId - the primary key of the portal instance
groupId - the primary key of the site's group
userId - the user who changed the content
className - the class name of the content model implementation
classPK - the primary key of the content to sanitize, 0 if not available
contentType - the content type. For more information, see ContentTypes.
modes - ways in which to run the sanitizer, such as Sanitizer.MODE_ALL, Sanitizer.MODE_BAD_WORDS, and/or Sanitizer.MODE_XSS
content - the content to sanitize
options - the options map
Returns:
the sanitized content
Throws:
SanitizerException - if a sanitizer exception occurred

Liferay 7.0-ce-b4