I put some items in my asset folder. Here as below :
|Asset
|_ONE
|_CAT.JPEG
I want to determine is "ONE" is a Directory, and "CAT.JPEG" is a file.
I Tried with something like below:
AssetManager _assetManager = Assets;
string[] _files = null;
try
{
_files = _assetManager.List("");
}
catch(IOException e)
{
Log.Error("Get All Child", "Failed to get asset file list.", e);
}
string _rootAssetFolder = "file:///android_asset/";
foreach(string _filename in _files)
{
string _sourcePathFull = _rootAssetFolder+ _filename;
Java.IO.File _target = new Java.IO.File(_sourcePathFull);
if(_target.IsDirectory)
{
Console.WriteLine("IS DIRECTORY");
}
else if(_target.IsFile)
{
Console.WriteLine("IS FILE");
}
else
{
Console.WriteLine("UNRECOGNIZE");
}
}
But I always get UNRECOGNIZE