You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ryan <ni...@yahoo.com> on 2002/06/06 23:17:23 UTC

can I get a directory listing in tomcat

Hello, 
I'm trying to get a directory listing as in the
example below, but an exception is thrown saying the
tomcat user does not have access to the /tmp
directory. Is the tomcat itself not allowing access to
the servers directory structure (i.e. the permissions
on /tmp are completely open i.e. 777)?? I'm using
tomcat 4 with jdk 1.4.0
Thanks,
Ryan

String dir = "/tmp/";
File fDir=new File(dir); // the directory
//tomcat cannot get past this line in the code.
String[] fileList=fDir.list(); // fetch the list

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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


Re: can I get a directory listing in tomcat

Posted by Ryan <ni...@yahoo.com>.
Phillip,
Thanks for the reply, after some searching and
debugging. I found you can add the following to the
$CATALINA_HOME/conf/catalina.policy file (grant
section) to add read permissions to everything .
 permission java.io.FilePermission "<<ALL FILES>>",
"read";
Thanks again,
Ryan
--- Phillip Morelock
<su...@phillipmorelock.com> wrote:
> I don't know how it works these days, but I faced
> this back in like 3.2.2:
> 
> Tomcat would not allow any access to the filesystem
> outside of the tomcat
> tree.  Check out the SECURITY_MANAGER_HOWTO, I
> think, as a place to start.
> 
> fillup
> 
> 
> On 6/6/02 2:17 PM, "Ryan" <ni...@yahoo.com> wrote:
> 
> > Hello, 
> > I'm trying to get a directory listing as in the
> > example below, but an exception is thrown saying
> the
> > tomcat user does not have access to the /tmp
> > directory. Is the tomcat itself not allowing
> access to
> > the servers directory structure (i.e. the
> permissions
> > on /tmp are completely open i.e. 777)?? I'm using
> > tomcat 4 with jdk 1.4.0
> > Thanks,
> > Ryan
> > 
> > String dir = "/tmp/";
> > File fDir=new File(dir); // the directory
> > //tomcat cannot get past this line in the code.
> > String[] fileList=fDir.list(); // fetch the list
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! - Official partner of 2002 FIFA World Cup
> > http://fifaworldcup.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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


Re: can I get a directory listing in tomcat

Posted by Phillip Morelock <su...@phillipmorelock.com>.
I don't know how it works these days, but I faced this back in like 3.2.2:

Tomcat would not allow any access to the filesystem outside of the tomcat
tree.  Check out the SECURITY_MANAGER_HOWTO, I think, as a place to start.

fillup


On 6/6/02 2:17 PM, "Ryan" <ni...@yahoo.com> wrote:

> Hello, 
> I'm trying to get a directory listing as in the
> example below, but an exception is thrown saying the
> tomcat user does not have access to the /tmp
> directory. Is the tomcat itself not allowing access to
> the servers directory structure (i.e. the permissions
> on /tmp are completely open i.e. 777)?? I'm using
> tomcat 4 with jdk 1.4.0
> Thanks,
> Ryan
> 
> String dir = "/tmp/";
> File fDir=new File(dir); // the directory
> //tomcat cannot get past this line in the code.
> String[] fileList=fDir.list(); // fetch the list
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


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