001 /** 002 * Copyright (c) 2000-2011 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.deploy.sandbox; 016 017 import com.liferay.portal.kernel.deploy.Deployer; 018 import com.liferay.portal.kernel.plugin.PluginPackage; 019 import com.liferay.portal.util.PortalUtil; 020 import com.liferay.util.ant.CopyTask; 021 022 import java.io.File; 023 024 /** 025 * @author Igor Spasic 026 * @author Brian Wing Shun Chan 027 */ 028 public class ThemeSandboxHandler extends BaseSandboxHandler { 029 030 public ThemeSandboxHandler(Deployer deployer) { 031 super(deployer); 032 } 033 034 @Override 035 protected void clonePlugin(File dir, PluginPackage pluginPackage) 036 throws Exception { 037 038 String portalWebDir = PortalUtil.getPortalWebDir(); 039 040 CopyTask.copyDirectory( 041 new File(portalWebDir, "html/themes/classic"), dir, null, 042 "/_diffs/**", true, true); 043 } 044 045 @Override 046 protected String getPluginType() { 047 return _PLUGIN_TYPE; 048 } 049 050 private static final String _PLUGIN_TYPE = "theme"; 051 052 }