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 35 public class SessionsTask extends AbstractCatalinaTask { 36 37 39 42 protected String path = null; 43 44 public String getPath() { 45 return (this.path); 46 } 47 48 public void setPath(String path) { 49 this.path = path; 50 } 51 52 54 59 public void execute() throws BuildException { 60 61 super.execute(); 62 if (path == null) { 63 throw new BuildException 64 ("Must specify 'path' attribute"); 65 } 66 67 try { 68 execute("/sessions?path=" + URLEncoder.encode(this.path, getCharset())); 69 } catch (UnsupportedEncodingException e) { 70 throw new BuildException 71 ("Invalid 'charset' attribute: " + getCharset()); 72 } 73 74 } 75 76 } 77 | Popular Tags |