Re: putMethod
"virtuallight" <[email protected]> Fri, 17 Aug 2007 19:47:33 -0700
| Newsgroups | gmane.comp.jakarta.slide.user |
|---|---|
| Message-ID | <[email protected]> |
Matthias, thanks for the response. I tried your suggestion and got the same result. Maybe a better question would be does it work at all when passing in a file object or an inputstream? Bill ----- Original Message ----- From: "Matthias Reischenbacher" <[email protected]> To: "Slide Users Mailing List" <[email protected]> Sent: Friday, August 17, 2007 7:37 AM Subject: Re: putMethod > Hey, > > try to use an absolute URL as parameter in the 'putMethod' method > > e.g.: > webdavResource.putMethod("http://localhost:8080/slide/files/slide/files", > file) > > Matthias > > virtuallight wrote: >> I am trying to write some files to my store programatically utilizing the >> WebDavResource putMethod. This all seems straight forward, at least on >> the surface. Perhaps someone can explain to me why the following will >> succeed : >> boolean success = container.putMethod("/slide/files/myfile.txt", "some >> text/n"); >> >> and the following will fail with a 403 forbidden error: >> >> url = new HttpURL("http://localhost:8080/slide/files/"); >> >> url.setUserinfo("root", "root"); >> >> container = new WebdavResource(url); >> >> if (container == null) >> >> { >> >> System.out.println("Container is null."); >> >> } >> >> File file = new File("c:/pdfs/myfile.txt"); >> >> if(file.exists()) >> >> { >> >> System.out.println("File is valid."); >> >> boolean success = container.putMethod(file); >> >> if(success) >> >> { >> >> System.out.println("File was added successfully."); >> >> } >> >> else >> >> { >> >> System.out.println("Failed to add file."); >> >> } >> >> I also tried this which failed as well. >> >> boolean success = container.putMethod(/slide/files, file); >> >> I have also tried using an inputstream with the same results. It would >> seem to me that these are the same. A file is created and written to >> /files. I have tried this on both the bundled tomcat version with user >> name root, password root which should be the administrator and with a >> setup in which authentication is disabled. Both yeild the same results. >> What have I missed? With authentication off should I not be able to do >> whatever I want? I am using the 2.1 version of Slide. >> >> Regards, >> >> Bill >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >