KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > installer > action > ListWarApplications


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.installer.action;
5
6 import com.tc.installer.util.WarFileFilter;
7 import com.zerog.ia.api.pub.CustomCodeAction;
8 import com.zerog.ia.api.pub.InstallerProxy;
9 import com.zerog.ia.api.pub.UninstallerProxy;
10
11 import java.io.File JavaDoc;
12 import java.io.FileFilter JavaDoc;
13
14 public class ListWarApplications extends CustomCodeAction {
15
16   public void install(InstallerProxy ip) {
17     String JavaDoc warDirPath = (String JavaDoc) ip.getVariable("WAR_FOLDER");
18     FileFilter filter = new WarFileFilter();
19     File JavaDoc[] warList = new File JavaDoc(warDirPath).listFiles(filter);
20     for (int i = 0; i < warList.length; i++) {
21       ip.setVariable("USR_WAR_" + i, ip.substitute(warList[i].getName()));
22     }
23   }
24
25   public void uninstall(UninstallerProxy up) {
26     // not implemented
27
}
28
29   public String JavaDoc getInstallStatusMessage() {
30     return "Validating WAR Files";
31   }
32
33   /**
34    * This method will be called to display a status message during the uninstall.
35    */

36   public String JavaDoc getUninstallStatusMessage() {
37     return "";
38   }
39 }
40
Popular Tags