ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Sliding into WebDAV
Subject:   Corrections for A Simple Example code
Date:   2004-07-12 10:56:56
From:   szpak
I could not get the SlideTest code to compile as listed in this article. Here are the corrections I made to get it to compile:



  • Instead of import org.apache.util.httpURL;, I used import org.apache.commons.httpclient.HttpURL;

  • Instead of hrl.setUserInfo("user", "pass");, I used hrl.setUserinfo("user", "pass");


With these changes the code to get a file compiled and ran properly.


I could not get the code for uploading a file to work. wdr.putMethod(fn) returns a boolean. When getting a file getMethod(fn) returns true, but when trying to upload a file putMethod(fn) always returned false. After lots of hair pulling and searching FAQs and the Slide mailing list I was able to get it to work as follows:

String filename = "myLocalFilename";
File fn = new File(filename);
String path = wdr.getPath() + "/" + filename;
boolean rslt = wdr.putMethod(path,fn);


Hope this is helpful. Now on to more complex stuff...


- Mark


1 to 3 of 3
1 to 3 of 3