1 17 18 19 package org.apache.catalina.ant; 20 21 22 import java.io.UnsupportedEncodingException ; 23 import java.net.URLEncoder ; 24 25 import org.apache.tools.ant.BuildException; 26 27 28 36 public class StopTask extends AbstractCatalinaTask { 37 38 39 41 42 45 protected String path = null; 46 47 public String getPath() { 48 return (this.path); 49 } 50 51 public void setPath(String path) { 52 this.path = path; 53 } 54 55 56 58 59 64 public void execute() throws BuildException { 65 66 super.execute(); 67 if (path == null) { 68 throw new BuildException 69 ("Must specify 'path' attribute"); 70 } 71 try { 72 execute("/stop?path=" + URLEncoder.encode(this.path, getCharset())); 73 } catch (UnsupportedEncodingException e) { 74 throw new BuildException 75 ("Invalid 'charset' attribute: " + getCharset()); 76 } 77 78 } 79 80 81 } 82 | Popular Tags |