1 31 32 package org.apache.commons.httpclient.methods; 33 34 import org.apache.commons.httpclient.HttpUrlMethod; 35 import org.apache.commons.httpclient.util.URIUtil; 36 37 import java.net.MalformedURLException ; 38 39 47 public class UrlHeadMethod extends HeadMethod implements HttpUrlMethod { 48 50 private String url; 51 52 55 public UrlHeadMethod() { 56 super(); 57 } 58 59 60 65 public UrlHeadMethod(String url) throws MalformedURLException { 66 super(URIUtil.getPath(url)); 67 setUrl(url); 68 } 69 70 78 public void setUrl(String url) throws MalformedURLException { 79 super.setPath(URIUtil.getPath(url)); 80 this.url = url; 81 String query = URIUtil.getQuery(url); 82 if (query != null && query.length() > 0) { 83 super.setQueryString(query); 84 } 85 } 86 87 92 public String getUrl() { 93 return url; 94 } 95 } 96 97 | Popular Tags |