title: How to give path of xls file residing in assets folder of android project using Apache POI
body: <p>I want to read .xls file residing in assets folder of android project. I'm using apache POI to read the file.</p>
  
  <p>But I'm not sure what could be the path of the file residing in assets folder.</p>
  
  <p>My code is as below:</p>
  
  <pre><code>// Creating Input Stream 
  File file = new File("file:///assets/test.xls");
  FileInputStream myInput = new FileInputStream(file);
  
  // Create a POIFSFileSystem object 
  POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput);
  
  // Create a workbook using the File System 
  HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem);
  
  // Get the first sheet from workbook 
  HSSFSheet mySheet = myWorkBook.getSheetAt(0);
  </code></pre>
  
  <p>Using this code, I get following error:</p>
  
  <pre><code>07-08 11:10:36.531: W/System.err(4417): java.io.FileNotFoundException: /file:/assets/test.xls: open failed: ENOENT (No such file or directory)
  07-08 11:10:36.531: W/System.err(4417):     at libcore.io.IoBridge.open(IoBridge.java:416)
  07-08 11:10:36.531: W/System.err(4417):     at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:78)
  07-08 11:10:36.531: W/System.err(4417):     at com.example.myfirstapp.MainActivity$1.onClick(MainActivity.java:78)
  07-08 11:10:36.531: W/System.err(4417):     at android.view.View.performClick(View.java:4222)
  07-08 11:10:36.531: W/System.err(4417):     at android.view.View$PerformClick.run(View.java:17273)
  07-08 11:10:36.531: W/System.err(4417):     at android.os.Handler.handleCallback(Handler.java:615)
  07-08 11:10:36.531: W/System.err(4417):     at android.os.Handler.dispatchMessage(Handler.java:92)
  07-08 11:10:36.531: W/System.err(4417):     at android.os.Looper.loop(Looper.java:137)
  07-08 11:10:36.531: W/System.err(4417):     at android.app.ActivityThread.main(ActivityThread.java:4895)
  07-08 11:10:36.539: W/System.err(4417):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-08 11:10:36.539: W/System.err(4417):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-08 11:10:36.539: W/System.err(4417):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
  07-08 11:10:36.539: W/System.err(4417):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
  07-08 11:10:36.539: W/System.err(4417):     at dalvik.system.NativeStart.main(Native Method)
  07-08 11:10:36.539: W/System.err(4417): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
  07-08 11:10:36.539: W/System.err(4417):     at libcore.io.Posix.open(Native Method)
  07-08 11:10:36.539: W/System.err(4417):     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
  07-08 11:10:36.539: W/System.err(4417):     at libcore.io.IoBridge.open(IoBridge.java:400)
  07-08 11:10:36.539: W/System.err(4417):     ... 13 more
  </code></pre>
  
  <p>What path do I have to provide to read my xls file??</p>