You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by polaris <sm...@hotmail.com> on 2005/02/27 06:44:32 UTC

[HTTPClient]naive problem

I use the following code to update a file exits  in tomcat v 5.5.8 server machine periodically.
the problem simply is that the file could not be uploaded though the returned boolean value is true.
I suppose the files are uploaded to the defaul tomcat directory webapps/ROOT

//************************************************//
  String url = "http://localhost:8080/";
  HttpClient client = new HttpClient(url);
 HttpURL hrl = new HttpURL(url);
 hrl.setUserinfo("user","pass");
    WebdavResource resource = new WebdavResource(hrl);
 String filename = "FileIndexPage.xml";
 File file = new File(filename);
 String path = resource.getPath() + "/" + filename;
 resource.putMethod( path,file );
 resource.close();
//***************************************************//
=
pleas help :-0