axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denise Wu <wadie...@gmail.com>
Subject Re: How to read file from META-INF
Date Fri, 05 Aug 2011 12:40:41 GMT
Nothing worked, I finally copied my xsd file into the 'classes'
directory that contain the service implementation classes, and then
read the xsd file using the following code from my service
'implementation class':

InputStream input = getClass().getResourceAsStream("BookReservation.xsd");
            	
StringBuilder sb = new StringBuilder();
String line;

BufferedReader reader;
reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));

while ((line = reader.readLine()) != null) {
	
	          sb.append(line).append("\n");
	          System.out.println("sb.toString()");
						  }


Thanks.

On Fri, Aug 5, 2011 at 1:48 AM, Deepal Jayasinghe <deepal@opensource.lk> wrote:
> Have a look at the following:
> http://wso2.org/library/259
>
> Thanks,
> Deepal
>> Hi,
>>
>> I tries all combinations using the getResource in calssloader but it's
>> not working.
>> Can you point to a sample code example please?
>>
>> Many thanks
>>
>>
>>
>> On Tue, Aug 2, 2011 at 4:24 PM, Deepal Jayasinghe <deepalk@gmail.com> wrote:
>>> You can get the class loader  and read the file using getResource as
>>> stream. Once you ask for the class loader it will give you the class
>>> loader that Axis2 has used to load the your service class.
>>>
>>> Thanks.
>>> Deepal
>>>
>>> On Tue, Aug 2, 2011 at 10:33 AM, Denise Wu <wadienil@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?
>>>>
>>>> Thank you.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> http://blogs.deepal.org
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-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
>
>



-- 
Wadienil.

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


Mime
View raw message