Java Question DirAssets

Discussion in 'Libraries developers questions' started by derez, May 9, 2012.

  1. derez

    derez Well-Known Member Licensed User

    How can I access File.DirAssets from a jave library ?

    I use the following code with Assets = True :
    Code:
    if(Assets) 
        st = 
    File.Combine(File.getDirAssets(), "WMMC.COF") ;
    else
        st = 
    File.Combine(File.getDirRootExternal() + "/Magnetics""WMMC.COF") ;
    and get the following error:
    when using False - it works (for File.DirRootExternal).
     
    Last edited: May 9, 2012
  2. Erel

    Erel Administrator Staff Member Licensed User

    The assets folder is not a real folder. You cannot treat it as a standard folder. The various File methods know how to treat this folder.
    The simplest solution is to call File.getInputStream. This method will open correctly all files.
     

Share This Page

Loading...