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 UrlPostMethod extends PostMethod implements HttpUrlMethod { 48 50 private String url; 51 52 55 public UrlPostMethod() { 56 super(); 57 } 58 59 64 public UrlPostMethod(String url) throws MalformedURLException { 65 super(URIUtil.getPath(url)); 66 setUrl(url); 67 } 68 69 75 public UrlPostMethod(String url, String tempDir) throws MalformedURLException { 76 super(URIUtil.getPath(url), tempDir); 77 setUrl(url); 78 } 79 80 87 public UrlPostMethod(String url, String tempDir, String tempFile) 88 throws MalformedURLException { 89 super(URIUtil.getPath(url), tempDir, tempFile); 90 setUrl(url); 91 } 92 93 101 public void setUrl(String url) throws MalformedURLException { 102 super.setPath(URIUtil.getPath(url)); 103 this.url = url; 104 String query = URIUtil.getQuery(url); 105 if (query != null && query.length() > 0) { 106 super.setQueryString(query); 107 } 108 } 109 110 115 public String getUrl() { 116 return url; 117 } 118 } 119 120 | Popular Tags |