tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rutledge, Aaron" <>
Subject RE: directory listing null through JSP
Date Fri, 13 Sep 2002 21:41:03 GMT
For anyone who ever has the same problem...The code works fine when Tomcat is started directly
using catalina start.  The problem only happens when TomCat is run as a service.  ANYONE KNOW

-----Original Message-----
From: Rutledge, Aaron 
Sent: Friday, September 13, 2002 12:11 PM
To: Tomcat Users List (E-mail)
Subject: directory listing null through JSP

Hi List,
I hope I am not double posting--my last e-mail bounced.

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 directory 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:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message