001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.kernel.util; 016 017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission; 018 019 import java.io.Reader; 020 021 /** 022 * <p> 023 * This class can compare two different versions of HTML code. It detects 024 * changes to an entire HTML page such as removal or addition of characters or 025 * images. 026 * </p> 027 * 028 * @author Julio Camarero 029 */ 030 public class DiffHtmlUtil { 031 032 public static String diff(Reader source, Reader target) throws Exception { 033 return getDiffHtml().diff(source, target); 034 } 035 036 public static DiffHtml getDiffHtml() { 037 PortalRuntimePermission.checkGetBeanProperty(DiffHtmlUtil.class); 038 039 return _diffHtml; 040 } 041 042 public void setDiffHtml(DiffHtml diffHtml) { 043 PortalRuntimePermission.checkSetBeanProperty(getClass()); 044 045 _diffHtml = diffHtml; 046 } 047 048 private static DiffHtml _diffHtml; 049 050 }