首页 > 其他 > 详细

java simple check whether a file or directory.

时间:2014-03-03 01:48:54      阅读:576      评论:0      收藏:0      [点我收藏+]

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:

1 new File(path).isDirectory();

Similary,check whether it a file by using:

1 new File(path).isFile();

java simple check whether a file or directory.,布布扣,bubuko.com

java simple check whether a file or directory.

原文:http://www.cnblogs.com/listened/p/3576262.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!