// 判断文件是否存在
public static boolean isFileExist(String fileName){
File f=new File(fileName);
if(f.exists()){
return true;
}else{
try {
f.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
}
}
Java中用FileIO流判断文件是否存在
最新推荐文章于 2023-09-02 20:06:38 发布