• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Create file object for each assets item.

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,

I have specific requirement I have few files in assets folder. I want that file in File object. (This is the requirement and I need to follow them STRICTLY,InputStream or any other is not allowed).

How to convert that ? SO far I have tried


but this does not work.

Any Help..

If I can achieve the same using raw folder,that is also fine for me.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am not quite sure but i think AssetManager has method called
String[] list(String path) (Thats because have never used it but i remember this 1)
So you can use getAsset() to get the assetManager and call this method
using this list you can get File object of your specific intrest.
Let me know if it works....

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Very true Vishal.

It gives list of all file's name. But what I want is path. File class takes absolute path in constructor's parameter. So my question is how to get absolute path of assets folder.
 
reply
    Bookmark Topic Watch Topic
  • New Topic