Check if a path represents a file or a folder

前端 未结 8 534
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 21:41

I need a valid method to check if a String represents a path for file or a directory. What are valid directory names in Android? As it comes out, folder names c

8条回答
  •  没有蜡笔的小新
    2020-12-07 21:59

    To check if a string represents a path or a file programatically, you should use API methods such as isFile(), isDirectory().

    How does system understand whether there's a file or a folder?

    I guess, the file and folder entries are kept in a data structure and it's managed by the file system.

提交回复
热议问题