You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Kishanthan Thangarajah <ks...@gmail.com> on 2011/12/06 13:32:48 UTC

Re: How to read file from META-INF

Hi Denise,

On Tue, Aug 2, 2011 at 8:03 PM, Denise Wu <wa...@gmail.com> wrote:
> Hi,
>
> I have a "mySchema.xsd" located in the META-INF directory in the
> webservice archive file myService.aar.
> I would like to read this file "mySchema.xsd" in my webservice class.
> How to access it at runtime?

I think you can access the file by using
getResourceAsStream("path/to/file") to read the file at run time.

Hope this helps.

Thanks,
Kishanthan.
>
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-dev-help@axis.apache.org
>

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


Re: How to read file from META-INF

Posted by Thomas Grabietz <to...@toms-toy.de>.
Hi Denise,

maybe you need the absolut path to open the file:

MessageContext msgContext = MessageContext.getCurrentMessageContext();
		ServletContext context = ((HttpServlet)
msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext();
		String path = context.getRealPath("/");

regards Tom


Am 06.12.2011 13:32, schrieb Kishanthan Thangarajah:
> Hi Denise,
> 
> On Tue, Aug 2, 2011 at 8:03 PM, Denise Wu <wa...@gmail.com> wrote:
>> Hi,
>>
>> I have a "mySchema.xsd" located in the META-INF directory in the
>> webservice archive file myService.aar.
>> I would like to read this file "mySchema.xsd" in my webservice class.
>> How to access it at runtime?
> 
> I think you can access the file by using
> getResourceAsStream("path/to/file") to read the file at run time.
> 
> Hope this helps.
> 
> Thanks,
> Kishanthan.
>>
>> Thank you.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-dev-help@axis.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 


-- 
Für's private
http://toms-toy.de/Thomas%20Grabietz%20tom@toms-toy.de%20(0xE43515AC)%20pub.asc

GIT d-(---)? s():()> a+ C$>++ UL$>+ P? L>++ E W>+++ N>++$ o K--? w>--- O
M>-- V PS>+ PE Y PGP>++$ t 5 X R tv b>+++ DI D G e> h>++ !r y>+

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