HELP!! HTTPClient - problem with PUT from HTTPConnection

Hi!
  I am developing a WebDAV Client which PUT's a file into a WebDAV
enabled server. I try putting a file into a non-existent URI
(collection), the program hangs when I try to read the response. (Which
is supposed to be 409 - conflict, when tested on an Internal server). I
am at loss to understand why this happens.
Here is a piece of my code


       {
        HTTPConnection m_HTTPConnection=new
HTTPConnection("www.myhost.com/WebDAV/");
        m_HTTPConnection.setCurrentProxy("www.myProxyHost.com",80);

        HttpOutputStream dos = new HttpOutputStream();
        NVPair header[] = new NVPair[2];
        header[0] = new NVPair("Content-Type",m_ContentType);
        header[1] = new NVPair("Authorization", "Basic " +
m_userPassword);


       HTTPResponse m_resp= m_HTTPConnection.Put(m_UrlObj.getFile(),
dos, header);

       // Reading from a local file and writing into HttpOutputStream
dos.write(bytearr);
        dos.close();

       /*               THIS IS WHERE MY PROGRAM HANGS            */

        int rescode = m_resp.getStatusCode();
        System.out.println("RESPONSE :
"+m_resp.getStatusCode()+m_resp.getReasonLine());

/*--------  */

        // Message 409 Implies Invalid state of resource, Attempting to
create the non existent collection specified by client
        if(rescode==409)   return(makeColl(SrURL,m_HTTPConnection));
       HTTPConnection.stop();

       }

         However, If I try to put into a collection that already exists,
I dont have any problems. There is some connection that is still kept
alive even though I explicitly close the connection. My program never
finishes execution, However I dont get this problem with an Internal
Local server, which I access through a proxy.

Looks like I am majorly missing something! I am using the HTTPClient
package from http://www.innovation.ch/java/HTTPClient/
HELP!
and Thanks!
Nithya

Received on Thursday, 21 February 2002 07:44:10 UTC