AssetManager find files (2 posts)

  • Profile picture of tralala tralala24p said 3 months, 2 weeks ago:

    Wouldn’t it be nice if assetManager had the ability to locate and list all files ending in a suffix under a specified folder ?

    Right now i am doing in a non platform portable way :

    File npcLocation = new File(FileUtilities.ASSET_DIRECTORY+"2d/npc/");
    String[] npcList = npcLocation.list(FileUtilities.SUPPORTED_IMAGES);
    
  • Profile picture of normen normen1290p said 3 months, 2 weeks ago:

    The problem is that the assetmanager doesn’t (and shouldn’t, really) require an AssetLocator to be able to deliver a list of files. Since you can register the classpath, jar files and even http servers this might not always be possible. What you can do however is do this yourself as you normally know what (and what kind of) roots you add to the assetManager.