getChildResources also only returns a file listing, not folders. Do I have to 
set a property or something telling it to grab folders?
Since a folder is just a logical grouping of files, is it still considered a 
"resource"?

I notice in the javadoc for getChildResources it says "Get all resources in 
this collection with the depth 1". Is it possible to get all resources with a 
depth of infinity (or an arbitrarily large number, say 10)? It would then be a 
simple matter to infer the (non-empty) folders from the returned files.

- Xavier

>>> [EMAIL PROTECTED] 29/06/2005 5:51:15 pm >>>
Xavier,
 
Try using getChildResources. This will return a list of WebdavResource which 
you can then test for each.
 
I found this to be the most reliable way to interrogate child resources in a 
collection.
 
Hth
Phil

        -----Original Message----- 
        From: Xavier Shay [mailto:[EMAIL PROTECTED] 
        Sent: Wed 29/06/2005 07:32 
        To: slide-user@jakarta.apache.org 
        Cc: 
        Subject: Re: Folder Listing
        
        

        Hi Andrew,
        I've checked out the article you mention, the most applicable part I 
found was the following:
        "Listing the files in the current directory is handled by the 
listFiles() method. Note in this example that again we check to make sure that 
we have the correct type of path.
        
        public String[] listFiles () throws Exception
        {
            if(!wdr.isCollection())
                throw new Exception ("Path is currently a file");
            return wdr.list();
        }"
        
        ... but no folders :(
        
        As for output, my test code just prints out the values of the three 
arrays I fetch, which contain correct file listings for the path I specify in 
the setPath() method, as long as I specify a valid path. What other output 
would help you?
        
        To reiterate, I am succesfully connecting to the WebDAV server, but 
cannot get a list of folders.
        Is a folder considered a "resource"?
        
        - Xavier
        
        >>> [EMAIL PROTECTED] 29/06/2005 11:05 am >>>
        On Wed, Jun 29, 2005 at 10:45:28AM +1000, Xavier Shay wrote:
        
        > I am trying to connect to Novell Netstorage, and can get file
        > listings for an arbitrary folder.
        >
        > How can I get a folder listing? I've tried the following code to no
        > avail:
        >
        > // --- START CODE ---
        > new HttpsURL("https://netstorage/oneNet/netstorage/";);
        > hrl.setUserinfo("user","pwd");
        
        You haven't included any output from your application to help debug
        it, so I'll assume you're including the appropriate context NDS
        context for the user "user".
        
        > wdr = new WebdavResource(hrl);
        >
        > wdr.setPath("/oneNet/NetStorage/Folder1/"); // I know this folder 
exists and has child folders
        >
        > // The following 3 methods fetch only subfiles of the current path, 
not folders
        > WebdavResource[] children = wdr.listWebdavResources();
        > Vector v = wdr.listBasic();
        > String [] folders = wdr.list();
        > // --- END CODE ---
        >
        > I know I'm just missing something in the API because DAV Explorer
        > and the novell web interface (which I presume uses WebDAV...) both
        > get folder listings correctly.
        
        I found the ONJava.com artcile "Sliding into WebDAV" to be a
        particularly useful resource when I was first fiddling about. See
        http://www.onjava.com/pub/a/onjava/2003/12/23/slide.html for a few
        pointers.
        
           - andrew
        
        --
        | Andrew Reid [mailto:[EMAIL PROTECTED] 
        | Overworked and Underpaid Network Monkey
        | C: +61-401-946-813  F: +61-8-8338-2518
        
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED] 
        For additional commands, e-mail: [EMAIL PROTECTED] 
        
        
        Swinburne University of Technology
        CRICOS Provider Code: 00111D
        
        NOTICE
        This e-mail and any attachments are confidential and intended only for 
the use of the addressee. They may contain information that is privileged or 
protected by copyright. If you are not the intended recipient, any 
dissemination, distribution, printing, copying or use is strictly prohibited. 
The University does not warrant that this e-mail and any attachments are secure 
and there is also a risk that it may be corrupted in transmission. It is your 
responsibility to check any attachments for viruses or defects before opening 
them. If you have received this transmission in error, please contact us on +61 
3 9214 8000 and delete it immediately from your system. We do not accept 
liability in connection with computer virus, data corruption, delay, 
interruption, unauthorised access or unauthorised amendment.
        
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED] 
        For additional commands, e-mail: [EMAIL PROTECTED] 
 
IMPORTANT NOTICE
If you have received this e-mail in error or wish to read our e-mail disclaimer 
statement and monitoring policy, please refer to the statement below or contact 
the sender.
This communication is from Deloitte & Touche LLP.   Deloitte & Touche LLP is a 
limited liability partnership registered in England and Wales with registered 
number OC303675.   A list of members' names is available for inspection at 
Stonecutter Court, 1 Stonecutter Street, London EC4A 4TR, United Kingdom, the 
firm's principal place of business and registered office.   Deloitte & Touche 
LLP is authorised and regulated by the Financial Services Authority.
This communication and any attachments contain information which is 
confidential and may also be privileged.   It is for the exclusive use of the 
intended recipient(s).  If you are not the intended recipient(s) please note 
that any form of disclosure, distribution, copying or use of this communication 
or the information in it or in any attachments is strictly prohibited and may 
be unlawful.  If you have received this communication in error, please return 
it with the title "received in error" to [EMAIL PROTECTED] then delete the 
email and destroy any copies of it.
E-mail communications cannot be guaranteed to be secure or error free, as 
information could be intercepted, corrupted, amended, lost, destroyed, arrive 
late or incomplete, or contain viruses.  We do not accept liability for any 
such matters or their consequences.  Anyone who communicates with us by e-mail 
is taken to accept the risks in doing so.
 When addressed to our clients, any opinions or advice contained in this e-mail 
and any attachments are subject to the terms and conditions expressed in the 
governing Deloitte & Touche LLP client engagement letter.
Opinions, conclusions and other information in this e-mail and any attachments 
which do not relate to the official business of the firm are neither given nor 
endorsed by it.

Swinburne University of Technology
CRICOS Provider Code: 00111D

NOTICE
This e-mail and any attachments are confidential and intended only for the use 
of the addressee. They may contain information that is privileged or protected 
by copyright. If you are not the intended recipient, any dissemination, 
distribution, printing, copying or use is strictly prohibited. The University 
does not warrant that this e-mail and any attachments are secure and there is 
also a risk that it may be corrupted in transmission. It is your responsibility 
to check any attachments for viruses or defects before opening them. If you 
have received this transmission in error, please contact us on +61 3 9214 8000 
and delete it immediately from your system. We do not accept liability in 
connection with computer virus, data corruption, delay, interruption, 
unauthorised access or unauthorised amendment.


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

Reply via email to