hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: javadoc fix and 1 bug found
Date Tue, 17 Dec 2002 16:02:47 GMT
Sylwester

There's more work that needs to be done on PutMethod. Currently PostMethod and PutMethod despite
massive commonalities are not even compatible on the API level. The use of deprecated methods
is the most glaring example of PutMethod requiring some attention. This said, most of the
refactoring work has been somewhat put on hold due to the pending (even imminent) alpha release

- isIpAddress needs to be removed (good catch)
- Sung-Gu should take a look at the Uri.java as that class is almost exclusively his department

Since all committers are busy today there's not much we can right now

Cheers

Oleg

-----Original Message-----
From: Sylwester Lachiewicz [mailto:matrix@plusnet.pl]
Sent: Tuesday, December 17, 2002 4:44 PM
To: Commons HttpClient Project
Subject: javadoc fix and 1 bug found


Hello,

i was looked into httpclient project and found few things:

Uri.java (line 214) parameter String fragment is never used - so constructed
url is incorrect - mayby new bugzilla bug
HttpMethodBase.java (line 2025) method   private static boolean
isIpAddress(String value)  is never used

a attach patch to fix javadoc comments and reorganize imports (remove unused
and sort)
also patch bellow will remove call to deprecated method

Can someone look at my patch and commit this to repository?


Sylwester

Index: org/apache/commons/httpclient/methods/PutMethod.java
===================================================================
RCS file:
/home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpc
lient/methods/PutMethod.java,v
retrieving revision 1.16
diff -u -r1.16 PutMethod.java
--- org/apache/commons/httpclient/methods/PutMethod.java 25 Oct 2002
10:15:52 -0000 1.16
+++ org/apache/commons/httpclient/methods/PutMethod.java 17 Dec 2002
15:21:04 -0000
@@ -62,21 +62,11 @@

 package org.apache.commons.httpclient.methods;

-import org.apache.commons.httpclient.HttpConnection;
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.HttpState;
-import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.*;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
 import java.net.URL;


@@ -254,7 +244,12 @@
                  getStatusLine().getStatusCode() != HttpStatus.SC_CONTINUE)
{
             return false;
         }
-        OutputStream out = conn.getRequestOutputStream((isHttp11() && (null
== getRequestHeader("Content-Length"))));
+        OutputStream out = null;
+        // getRequestOutputStream(boolean useChunking) was deprecated
+        if ((isHttp11() && (null == getRequestHeader("Content-Length"))))
+            out = new ChunkedOutputStream(conn.getRequestOutputStream());
+        else
+            out = conn.getRequestOutputStream();

         InputStream inputStream = null;
         if (file != null && file.exists()) {

Mime
View raw message