You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Rutledge, Aaron" <AR...@5prime.com> on 2002/09/13 19:00:57 UTC

directory listing null through JSP

I am trying to create a JSP page that lists contents on a network filesystem.  I am creating a file object using 

File dir = new File("//FILESERVER/Public_Folder");

and then I want to list all of the files using...

 File[] children = dir.listFiles();
 if (children == null) {%>
            Either dir does not exist or is not a directory
        <%} else {
            for (int i=0; i<children.length; i++) {

but "children" will only return null even though the file has subfiles!  I have run the same piece of code in the main method of an application and it works perfectly.  Why would this cause problems in TomCat?  Is it a security access issue?  Is there a way to overcome this?  I have been stuck on this simple problem for weeks!  Any help greatly appreciated.  Regrads to all, Aaron

BTW:  When I replace the network path with a local path it works fine. 



  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>