putMethod
"virtuallight" <[email protected]> Fri, 17 Aug 2007 10:28:36 -0700
| Newsgroups | gmane.comp.jakarta.slide.user |
|---|---|
| Message-ID | <[email protected]> |
------=_NextPart_000_0005_01C7E0B9.5EE86A90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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 =3D container.putMethod("/slide/files/myfile.txt", "some =
text/n");
and the following will fail with a 403 forbidden error:
url =3D new HttpURL("http://localhost:8080/slide/files/");
url.setUserinfo("root", "root");
container =3D new WebdavResource(url);
if (container =3D=3D null)
{
System.out.println("Container is null.");
}
File file =3D new File("c:/pdfs/myfile.txt");
if(file.exists())
{
System.out.println("File is valid.");
boolean success =3D 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 =3D 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
------=_NextPart_000_0005_01C7E0B9.5EE86A90--