//recuperar los datos del server
//Server server = new Server();
//verificar si la aplicasion esta corriendo?
////http://localhost:8080/manager/list
HttpClient hc1 = new HttpClient("localhost",8080,"tomcat","admin","");
boolean lb = hc1.appIsRunning("Binary");
boolean ub=false;
boolean db=false;
if(lb){
// autenticar y undeploy la aplicacion en el tomcat.
////http://localhost:8080/manager/undeploy?path=/Binary
String undeploy = "http://localhost:8080/manager/undeploy?path=/Binary";
HttpClient hc2 = new HttpClient("localhost",8080,"tomcat","admin",undeploy);
ub=hc2.execute();
}
//Copy WAR
//confirmar upload
if((lb && ub) || (!lb) ){
//Deploy WAR
//enviar comando al tomcat
////http://localhost:8080/manager/deploy?path=/Binary&war=file:/tmp/Binary.war
String deploy = "http://localhost:8080/manager/deploy?path=/Binary&war=file:/tmp/Binary.war";
HttpClient hc3 = new HttpClient("localhost",8080,"tomcat","admin",deploy);
db=hc3.execute();
}
fso = new FinalScreenOutput();
fso.setPageTitle ("Upload-Deploy War[Finished]");