java simple check whether a file or directory.

Ref:  check whether a file or directory

First, make sure the path exists by using:

new File(path).exists();

Then check whether it a directory using:

 new File(path).isDirectory();

Similary,check whether it a file by using:

 new File(path).isFile();
上一篇:php函数parse_url


下一篇:CF 253B Two Heaps