W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2008

2006/unicorn/org/w3c/unicorn/util ClientHttpRequest.java,1.4,1.5

From: Jean-Guilhem Rouel via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 24 Sep 2008 12:21:59 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1KiTNX-0003n4-GS@lionel-hutz.w3.org>

Update of /sources/public/2006/unicorn/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv14552/org/w3c/unicorn/util

Modified Files:
	ClientHttpRequest.java 
Log Message:
Forcing POST request for file upload on Jigsaw

Index: ClientHttpRequest.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/util/ClientHttpRequest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ClientHttpRequest.java	17 Jun 2008 13:45:31 -0000	1.4
+++ ClientHttpRequest.java	24 Sep 2008 12:21:57 -0000	1.5
@@ -7,6 +7,7 @@
 import java.io.OutputStream;
 import java.net.URL;
 import java.net.URLConnection;
+import java.net.HttpURLConnection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -29,7 +30,7 @@
 
 	private static Random aRandom = new Random();
 
-	private URLConnection aURLConnection;
+	private HttpURLConnection aURLConnection;
 	private OutputStream aOutputStream = null;
 	private Map<String, String> mapOfCookie = new HashMap<String, String>();
 
@@ -118,9 +119,11 @@
 	 */
 	public ClientHttpRequest (
 			final URLConnection aURLConnection) throws IOException {
+      System.out.println(aURLConnection);
 		ClientHttpRequest.logger.trace("Constructor(URLConnection)");
-		this.aURLConnection = aURLConnection;
+		this.aURLConnection = (HttpURLConnection) aURLConnection;
 		this.aURLConnection.setDoOutput(true);
+    this.aURLConnection.setRequestMethod("POST");
 		this.aURLConnection.setRequestProperty(
 				"Content-Type",
 				"multipart/form-data; boundary=" + this.sBoundary);
@@ -132,9 +135,8 @@
 	 * @param aURL the URL to send request to
 	 * @throws IOException
 	 */
-	public ClientHttpRequest (
-			final URL aURL) throws IOException {
-		this(aURL.openConnection());
+	public ClientHttpRequest (final URL aURL) throws IOException {
+      this(aURL.openConnection());
 		ClientHttpRequest.logger.trace("Constructor(URL)");
 		if (ClientHttpRequest.logger.isDebugEnabled()) {
 			ClientHttpRequest.logger.debug("URL : " + aURL + ".");
Received on Wednesday, 24 September 2008 12:22:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:02:30 UTC