Hi,

I still have problems to access a file inside an .aar. I tried to extend the
simple "quickstart" example from the axis2 repository, but I won't get
access?!?!?!

The .aar folder structure is
META-INF/
samples/...
res/stock.txt


here is my code:

#########################################
package samples.quickstart.service.pojo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;


public class StockQuoteService
{
    private HashMap map = new HashMap();

    public double getPrice(String symbol) {
                StockQuoteService i = new StockQuoteService();
        InputStream a =
i.getClass().getClassLoader().getResourceAsStream("res/stock.txt");
        
//      Thread thread = Thread.currentThread();
//      ClassLoader loader = thread.getContextClassLoader();
//      thread.setContextClassLoader(i.getClass().getClassLoader());
//      InputStream a =
Thread.currentThread().getContextClassLoader().getResourceAsStream("res/stock.txt");
        

        return Double.valueOf(i.convertStreamToString(a)).doubleValue();
    }
      
    private String convertStreamToString(InputStream a)
        {
        BufferedReader reader = new BufferedReader(new InputStreamReader(a));
    .....}

}
#########################################
-- 
View this message in context: 
http://www.nabble.com/get-Resource-inside-.aar--tp21019445p21019445.html
Sent from the Axis - User mailing list archive at Nabble.com.

Reply via email to