You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Tina Yang <ti...@webman.de> on 2001/07/24 17:52:11 UTC

getUserInfo of a WebdavResource

Hi,

I'm trying to get user information of a WebdavResource. Since there is
almost no documentation about this, I tried the following:

webdavResource = new WebdavResource("http://www.anurl.com/aresource");
httpURL = webdavResource.getHttpURL();
System.out.println("owner: " + httpURL.getUserInfo());

But unfortunately getUserInfo returns null.

Is there any other way to find out who owns a resource, who locked it,
and who can read/write a resource?

Many thanks in advance,

-- Tina.


Re: getUserInfo of a WebdavResource

Posted by Dirk Verbeeck <di...@pandora.be>.
Tina Yang wrote:

> Hi,
>
> I'm trying to get user information of a WebdavResource. Since there is
> almost no documentation about this, I tried the following:
>
> webdavResource = new WebdavResource("http://www.anurl.com/aresource");
> httpURL = webdavResource.getHttpURL();
> System.out.println("owner: " + httpURL.getUserInfo());
> But unfortunately getUserInfo returns null.

httpURL is the http connection information
getUserInfo gives you user info of the connection
but you didn't use http://user:pass@www.anurl.com/aresource
and that is why it's null

> Is there any other way to find out who owns a resource, who locked it,
> and who can read/write a resource?

You need to look up the owner property, just one of the propfindMethods
Enumeration propfindMethod("owner")

Never used it, but this looks like a good start for lock owners
public Enumeration getActiveLockOwners()
or look up the LockDiscoveryProperty with:
LockDiscoveryProperty getLockDiscovery()

And the read/write permissions can be retieved using:
AclProperty aclfindMethod("/aresource")
look at the slide command line tool for an example for displaying an
AclProperty.


Dirk