1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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  }