开发者

Android Development: How To Check If FTPFile Is a Directory?

开发者 https://www.devze.com 2023-03-18 21:17 出处:网络
In my app I have a ListView which I populate with names of files and folders in a directory for my file browser.

In my app I have a ListView which I populate with names of files and folders in a directory for my file browser.

I have overrid the getView method so that I can manually set a d开发者_如何学Cifferent icon in each row of the ListView depending on the child's file type, or if it's a directory or not.

Now if I were to check if a path on the sdcard is a directory I'd simply do:

if(new File("/sdcard/folder/path").isDirectory()){
 icon.setImageResource(R.drawable.foldericon); 
}

But when dealing with FTPFile's that method doesn't seem to work.

Does anybody know how I can achieve the same outcome as the code above but with an FTPFile?

0

精彩评论

暂无评论...
验证码 换一张
取 消