01: package com.jat.core.installer.step;
02:
03: import java.io.File;
04: import com.jat.core.installer.util.CommandExec;
05:
06: /**
07: * <p>Title: JAT</p>
08: * <p>Description: </p>
09: * <p>Copyright: Copyright (c) 2004 - 2005 Stefano Fratini</p>
10: * <p>Distributed under the terms of the GNU Lesser General Public License, v2.1 or later</p>
11: * @author stf
12: * @version 1.2
13: */
14: public class UnixWebApplication extends WebApplication {
15:
16: public void unwar(String warFile, String tempDir) throws Exception {
17: createPath(tempDir);
18: CommandExec commandEx = new CommandExec();
19: String[] cmd = new String[4];
20: cmd[0] = JatProject.getFilename(new File("bin")
21: .getAbsolutePath(), "unwar.sh");
22: cmd[1] = new File(tempDir).getAbsolutePath();
23: cmd[2] = "-xf";
24: cmd[3] = new File(warFile).getAbsolutePath();
25: commandEx.execute(cmd);
26: }
27:
28: public String war(String tempDir, String projectName)
29: throws Exception {
30: CommandExec commandEx = new CommandExec();
31: String[] cmd = new String[5];
32: cmd[0] = JatProject.getFilename(new File("bin")
33: .getAbsolutePath(), "war.sh");
34: cmd[1] = new File(tempDir).getAbsolutePath();
35: cmd[2] = "-cf0";
36: cmd[3] = projectName + ".war";
37: cmd[4] = "*";
38: commandEx.execute(cmd);
39: return projectName + ".war";
40: }
41:
42: protected UnixWebApplication() {
43: super();
44: }
45: }
|