Thread.currentThread().getContextClassLoader.getResources("myproperties.prop
erties"); or
Thread.currentThread().getContextClassLoader.getResources("./myproperties.pr
operties");
should return the contents of the file myproperties.properties in
WEB-INF/classes for example
Filip
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net
> -----Original Message-----
> From: Jim Downing [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 23, 2001 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Accessing a packaged file
>
>
> I've tried both ways, and I'm still missing something.
> Thread.currentThread().getContextClassLoader.getResources("") doesn't list
> the resource required - do I have to list it in the web.xml descriptor?
>
> jim
>
> ----- Original Message -----
> From: "Samson, Lyndon [IT]" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 23, 2001 5:47 PM
> Subject: RE: Accessing a packaged file
>
>
> > Or more succinctly;
> >
> > this.getClass().getResourceAsStream(String);
> >
> > From: Filip Hanik [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, April 23, 2001 5:28 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Accessing a packaged file
> >
> >
> > Thread.currentThread().getContextClassLoader().getResourceAsStream
> >
> > picks up files in your WEB-INF/classes or WEB-INF/lib inside of a jar or
> zip
> > Filip
> >
> > ~
> > Namaste - I bow to the divine in you
> > ~
> > Filip Hanik
> > Software Architect
> > [EMAIL PROTECTED]
> > www.filip.net
> >
> > > -----Original Message-----
> > > From: Jim Downing [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, April 23, 2001 9:09 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Accessing a packaged file
> > >
> > >
> > > Hi,
> > > I'm trying to get a servlet to access a text file that has
> been packaged
> > > with the servlet in a .war file. Is it possible to access the file
> without
> > > knowing it's absolute path when deployed, and if so how?
> > >
> > > jim
> > >
> > >
> >
>
>