001
014
015 package com.liferay.portal.kernel.sanitizer;
016
017 import java.io.InputStream;
018 import java.io.OutputStream;
019
020 import java.util.Map;
021
022
026 public class SanitizerWrapper implements Sanitizer {
027
028 public SanitizerWrapper(Sanitizer sanitizer) {
029 _originalSanitizer = sanitizer;
030 _sanitizer = sanitizer;
031 }
032
033 public byte[] sanitize(
034 long companyId, long groupId, long userId, String className,
035 long classPK, String contentType, String[] modes, byte[] byteArray,
036 Map<String, Object> options)
037 throws SanitizerException {
038
039 return _sanitizer.sanitize(
040 companyId, groupId, userId, className, classPK, contentType, modes,
041 byteArray, options);
042 }
043
044 public void sanitize(
045 long companyId, long groupId, long userId, String className,
046 long classPK, String contentType, String[] modes,
047 InputStream inputStream, OutputStream outputStream,
048 Map<String, Object> options)
049 throws SanitizerException {
050
051 _sanitizer.sanitize(
052 companyId, groupId, userId, className, classPK, contentType, modes,
053 inputStream, outputStream, options);
054 }
055
056 public String sanitize(
057 long companyId, long groupId, long userId, String className,
058 long classPK, String contentType, String[] modes, String s,
059 Map<String, Object> options)
060 throws SanitizerException {
061
062 return _sanitizer.sanitize(
063 companyId, groupId, userId, className, classPK, contentType, modes,
064 s, options);
065 }
066
067 public void setSanitizer(Sanitizer sanitizer) {
068 if (sanitizer == null) {
069 _sanitizer = _originalSanitizer;
070 }
071 else {
072 _sanitizer = sanitizer;
073 }
074 }
075
076 private Sanitizer _originalSanitizer;
077 private Sanitizer _sanitizer;
078
079 }