Get folders name from Assets directory
NickName:Nox Ask DateTime:2010-07-19T21:05:16

Get folders name from Assets directory

I'm trying to get the names of my folders in "assets". I can get the names of the files with an AssetManager by using the method assetManager.list(). But the problem is that it return only files' name and not folders' names. So I'm trying to use the listFiles() method but i can't access to the Assets directory; I've try the following :

File dir = new File ("file:///android_asset/");
File[] files= dir.listFiles();

But it doesn't work :( ... Is there a way to get the folders' names contained in the Assets directory ?

Copyright Notice:Content Author:「Nox」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/3281245/get-folders-name-from-assets-directory

More about “Get folders name from Assets directory” related questions

Get folders name from Assets directory

I'm trying to get the names of my folders in "assets". I can get the names of the files with an AssetManager by using the method assetManager.list(). But the problem is that it return only files' n...

Show Detail

Random folders being created on assets directory Yii

Can someone explain me why random folders are being created at assets directory of my Yii project. Since I am using SVN to control the versions, is it necessary to commit those folders as well ?

Show Detail

How do I loop over all Assets folders and sub folders and get to a list all the prefabs in this folders?

This code get all the sub folders in a Assets specific folder. using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using UnityEditor;...

Show Detail

Yii creating empty assets folders

I'm running a Yii app with Wampserver, I pulled it from a git repository so it had no assets folders, I had to manually create each one because it was throwing a CException. Now when I load any pa...

Show Detail

How to convert Directory Folders and Files to json string

I am working on Windows Form and I want to convert Directory Folders and Files to Json string like below,I am using newton json and have a json string like below with multiple Folders and Files , d...

Show Detail

Gulp - How To Get Parent Directory Name

Say I have the following website structure: wwwroot ---- css -------- clientA ------------ styles.css -------- clientB -------- clientC assets ---- sass -------- clientA ------------ styles.scss ...

Show Detail

Get list of folders from assets folder

I'm trying to load files from assets folder. Assets folder contains two folders dir1, dir2 and file file1. I'm using following code: AssetManager am = getAssets(); String[] data = null; try { ...

Show Detail

Struggling with assets folders

I've been struggling with a simple assets directory listing. I have the following structure (roughly speaking): -dirA --data.xml --AudioSUBdir ---some files here --VideoSUBdir ---some files here -...

Show Detail

Moving folders to a directory according to their name

I'm new in Python and am currently developing an application that moves folders to a specific directory according their folder name. I get no errors nor warnings but the application won't move the

Show Detail

how to handle assets from different folders in gulp

I have list of glob patterns: var assets = [ '../projects.a/dir1/dir2/file1.js', '../projects.b/dir1/dir2/file2.js', './app/scripts/dir1/dir2/module.js' ]; I want to create a task

Show Detail