1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
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  /**
23   * <a href="Sanitizer.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Zsolt Balogh
26   * @author Brian Wing Shun Chan
27   */
28  public interface Sanitizer {
29  
30      public static final String MODE_ALL = "ALL";
31  
32      public static final String MODE_BAD_WORDS = "BAD_WORDS";
33  
34      public static final String MODE_XSS = "XSS";
35  
36      public byte[] sanitize(
37              long companyId, long groupId, long userId, String className,
38              long classPK, String contentType, String[] modes, byte[] byteArray,
39              Map<String, Object> options)
40          throws SanitizerException;
41  
42      public void sanitize(
43              long companyId, long groupId, long userId, String className,
44              long classPK, String contentType, String[] modes,
45              InputStream inputStream, OutputStream outputStream,
46              Map<String, Object> options)
47          throws SanitizerException;
48  
49      public String sanitize(
50              long companyId, long groupId, long userId, String className,
51              long classPK, String contentType, String[] modes, String s,
52              Map<String, Object> options)
53          throws SanitizerException;
54  
55  }