You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "STOCKHOLM, Raymond" <R....@aubay.lu> on 2004/06/16 09:15:11 UTC

How can I access a file located in WEB-INF

Hi,

I need to access a file located in the directory WEB-INF of my web application.
In fact, in WEB-INF/conf.
How can I open this file in one of my servlet ?

Any advise is welcome.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How can I access a file located in WEB-INF

Posted by Tim Funk <fu...@joedog.org>.
FAQ
http://jakarta.apache.org/tomcat/faq/misc.html#getResourceAsStream

-Tim

STOCKHOLM, Raymond wrote:

> Hi,
> 
> I need to access a file located in the directory WEB-INF of my web application.
> In fact, in WEB-INF/conf.
> How can I open this file in one of my servlet ?
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: How can I access a file located in WEB-INF

Posted by Tom K <tk...@cox.net>.
File dir = new File("directoryName");
    
    String[] children = dir.list();
    if (children == null) {
        // Either dir does not exist or is not a directory
    } else {
        for (int i=0; i<children.length; i++) {
            // Get filename of file or directory
            String filename = children[i];
        }
    }

Tom Kochanowicz

-----Original Message-----
From: STOCKHOLM, Raymond [mailto:R.STOCKHOLM@aubay.lu] 
Sent: Wednesday, June 16, 2004 2:15 AM
To: Tomcat Users List
Subject: How can I access a file located in WEB-INF

Hi,

I need to access a file located in the directory WEB-INF of my web
application.
In fact, in WEB-INF/conf.
How can I open this file in one of my servlet ?

Any advise is welcome.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.682 / Virus Database: 444 - Release Date: 5/11/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.682 / Virus Database: 444 - Release Date: 5/11/2004
 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org