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 Suresh Rao Ambarkar <sa...@boniva.com> on 2005/03/03 10:28:04 UTC
How can we create WebdavResource...
Hi all,
I am beginner to WebDAV. I started slide server and created WebdavResource.
I am listing the files by using WebdavResource.list() method.
But here I am not able to get the list.
Where as I am getting Exception while listing the files in the
WebdavResource.
Please tell me how can I list files which are in the WebdavResource.
===================================code=====================================
=================================
public class ListResources extends WebdavResource
{
public static void main (String args[])
{
try
{
HttpURL hrl = new
HttpURL("http://127.0.0.1:8080/slide/users/root");
hrl.setUserinfo("root","root");
WebdavResource wdr = new WebdavResource(hrl,0,1);
java.util.Vector fileList = wdr.listBasic();
wdr.close();
}
catch(MalformedURLException mue)
{
mue.printStackTrace();
}
catch(HttpException he)
{
he.printStackTrace();
}
catch(IOException ioe)
{
ioe.printStackTrace();
}
catch(Exception e)
{
System.out.println("Exception="+e.getMessage());
e.printStackTrace();
}
}
}
============================================================================
=============================
Please help me in this context.
Thanks & Regards,
Suresh.
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org
Re: How can we create WebdavResource...
Posted by Da...@inventivedesigners.com.
"Suresh Rao Ambarkar" <sa...@boniva.com> wrote on 03/03/2005 10:28:04:
> I am listing the files by using WebdavResource.list() method.
> But here I am not able to get the list.
> Where as I am getting Exception while listing the files in the
> WebdavResource.
> Please tell me how can I list files which are in the WebdavResource.
Exactly the same question was asked yesterday...
I will post exactly the same response...
> we can create new webdav resource by using
> WebdavResource(HttpURL httpURL, int action, int depth) constructor.
> Here, what is the significance of action and depth? how can we set these
> values.
action: the action to set properties of this resource:
WebdavResource.NOACTION: No action to find properties for this resource.
WebdavResource.NAME: The action setting only the displayname for this
resource.
WebdavResource.BASIC: The action setting the basic properties for this
resource.
WebdavResource.DEFAULT: The action setting the default DAV properties for
this resource.
WebdavResource.ALL: The action setting the all properties for this
resource.
If you specify NOACTION, the webdav resource is not consulted when you
call the constructor. When ALL is specified, all properties are retrieved
from the resource, so the resource is contacted (so it must exist).
depth: The depth to find properties. The values of DepthSupport.DEPTH_0,
DepthSupport.DEPTH_1, DepthSupport.DEPTH_INFINITY is possbile for the
depth.
If depth is 0, only the requested properties of the resource are returned.
When it is 1, the requested props of the resource and its direct children
are returned. When infinite depth is requested, the requested properties
of the resource and all its descendants are returned.
> Actually, I created webdav resource like this:
> WebdavResource wdr = new WebdavResource(httpURL,0,1);
> But here, I am trying to list the files by using
> wdr.list();
I don't know what you're trying to do, but if you want to use the
retrieved children, you can better use the wdr.getChildResources() method.
> Here I am not able to access the list() method.
How do you mean? It's a public method...
Some code i use successfully:
fSessionResource = new WebdavResource(hrl, WebdavResource.ALL, 0, true);
final WebdavResources resources = fSessionResource.getChildResources();
I never use the list method, but I guess this will work too.
Regards,
David.
--------------------------------------------------
Inventive Designers' Email Disclaimer:
http://www.inventivedesigners.com/email-disclaimer
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org