1
22
23 package com.liferay.portal.deploy.auto;
24
25 import com.liferay.portal.deploy.DeployUtil;
26 import com.liferay.portal.kernel.deploy.auto.AutoDeployException;
27 import com.liferay.portal.kernel.log.Log;
28 import com.liferay.portal.kernel.log.LogFactoryUtil;
29 import com.liferay.portal.kernel.util.PropsKeys;
30 import com.liferay.portal.kernel.util.ServerDetector;
31 import com.liferay.portal.kernel.util.StringPool;
32 import com.liferay.portal.tools.deploy.WebDeployer;
33 import com.liferay.portal.util.PrefsPropsUtil;
34 import com.liferay.portal.util.PropsValues;
35
36 import java.util.ArrayList;
37 import java.util.List;
38
39
44 public class WebAutoDeployer extends WebDeployer implements AutoDeployer {
45
46 public WebAutoDeployer() {
47 try {
48 baseDir = PrefsPropsUtil.getString(
49 PropsKeys.AUTO_DEPLOY_DEPLOY_DIR,
50 PropsValues.AUTO_DEPLOY_DEPLOY_DIR);
51 destDir = DeployUtil.getAutoDeployDestDir();
52 appServerType = ServerDetector.getServerId();
53 unpackWar = PrefsPropsUtil.getBoolean(
54 PropsKeys.AUTO_DEPLOY_UNPACK_WAR,
55 PropsValues.AUTO_DEPLOY_UNPACK_WAR);
56 filePattern = StringPool.BLANK;
57 jbossPrefix = PrefsPropsUtil.getString(
58 PropsKeys.AUTO_DEPLOY_JBOSS_PREFIX,
59 PropsValues.AUTO_DEPLOY_JBOSS_PREFIX);
60 tomcatLibDir = PrefsPropsUtil.getString(
61 PropsKeys.AUTO_DEPLOY_TOMCAT_LIB_DIR,
62 PropsValues.AUTO_DEPLOY_TOMCAT_LIB_DIR);
63
64 List<String> jars = new ArrayList<String>();
65
66 addExtJar(jars, "ext-util-java.jar");
67 addRequiredJar(jars, "util-java.jar");
68
69 this.jars = jars;
70
71 checkArguments();
72 }
73 catch (Exception e) {
74 _log.error(e);
75 }
76 }
77
78 public void autoDeploy(String file) throws AutoDeployException {
79 List<String> wars = new ArrayList<String>();
80
81 wars.add(file);
82
83 this.wars = wars;
84
85 try {
86 deploy();
87 }
88 catch (Exception e) {
89 throw new AutoDeployException(e);
90 }
91 }
92
93 private static Log _log = LogFactoryUtil.getLog(WebAutoDeployer.class);
94
95 }