工具类——判断文件是否存在

判断本地文件是否存在

public static boolean fileExitis(File file) {
    if (file.exists()) {
        System.out.println("找到指定的文件了");
        return true;
    } else {
        System.out.println("未找到指定文件");
        return false;
    }
}

 

 
posted @ 2018-04-13 20:30  碎冰  阅读(477)  评论(0)    收藏  举报