1
14
15 package com.liferay.portal.kernel.sanitizer;
16
17 import java.io.InputStream;
18 import java.io.OutputStream;
19
20 import java.util.Map;
21
22
28 public class SanitizerWrapper implements Sanitizer {
29
30 public SanitizerWrapper(Sanitizer sanitizer) {
31 _originalSanitizer = sanitizer;
32 _sanitizer = sanitizer;
33 }
34
35 public byte[] sanitize(
36 long companyId, long groupId, long userId, String className,
37 long classPK, String contentType, String[] modes, byte[] byteArray,
38 Map<String, Object> options)
39 throws SanitizerException {
40
41 return _sanitizer.sanitize(
42 companyId, groupId, userId, className, classPK, contentType, modes,
43 byteArray, options);
44 }
45
46 public void sanitize(
47 long companyId, long groupId, long userId, String className,
48 long classPK, String contentType, String[] modes,
49 InputStream inputStream, OutputStream outputStream,
50 Map<String, Object> options)
51 throws SanitizerException {
52
53 _sanitizer.sanitize(
54 companyId, groupId, userId, className, classPK, contentType, modes,
55 inputStream, outputStream, options);
56 }
57
58 public String sanitize(
59 long companyId, long groupId, long userId, String className,
60 long classPK, String contentType, String[] modes, String s,
61 Map<String, Object> options)
62 throws SanitizerException {
63
64 return _sanitizer.sanitize(
65 companyId, groupId, userId, className, classPK, contentType, modes,
66 s, options);
67 }
68
69 public void setSanitizer(Sanitizer sanitizer) {
70 if (sanitizer == null) {
71 _sanitizer = _originalSanitizer;
72 }
73 else {
74 _sanitizer = sanitizer;
75 }
76 }
77
78 private Sanitizer _originalSanitizer;
79 private Sanitizer _sanitizer;
80
81 }