W3C home > Mailing lists > Public > www-talk@w3.org > January to February 2002

HELP!! HTTPClient - problem with PUT from HTTPConnection

From: Nithya Veluswamy <nithya.lakshmi@oracle.com>
Date: Thu, 21 Feb 2002 18:08:39 +0530
Message-ID: <3C74EA4F.231C6B8C@oracle.com>
To: www-jigsaw@w3.org, www-talk@w3.org, WEBDAV mailing list <www-webdav-dasl@w3.org>
  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

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

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

       // Reading from a local file and writing into HttpOutputStream

       /*               THIS IS WHERE MY PROGRAM HANGS            */

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

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

        // 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));


         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/
and Thanks!
Received on Thursday, 21 February 2002 07:44:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:03 UTC