I haven't tried it myself but there's a setUserInfo() method on the
WebdavResource() to set username/password in the encapsulated httpURL
object. This may not be of much use if you want to construct a
WebdavResource and connect to it in one call though. There's also
constructors that take a Credential and ones that take an HttpURL. With the
latter you could construct an HttpURL with username and password then
construct the WebdavResource with it.

Check the slide user list archives for more info though as I haven't used
any of the authentication interfaces myself.

Warwick



-----Original Message-----
From: Matt Reason [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 09, 2004 6:32 PM
To: [EMAIL PROTECTED]
Subject: How to put a file on a webdav server that requires a password?


 
Hi,
 
I've downloaded and installed the webdav client.  I am able put files on a
local webdav server that does not require a password with this code:
 
            WebdavResource webdavResource = new WebdavResource(inURL);
            File file = new File (inFile);
            if (webdavResource.putMethod(inRemotePathAndName, file)) {
                System.out.println("It worked: " +
webdavResource.getStatusMessage());
            } else {
                System.out.println("It didn't work: " +
webdavResource.getStatusMessage());
            }
 
But now I have to send the file to a server that requires a password.  I
have searched the javadoc like crazy and it says nothing about
passwords.   Is there a way to do it?  
 
Thanks in advance, 
 
Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to