java中判断文件及所在文件夹是否存在

File file=new File(filePath);
if (file.exists()) {
}else {
File fileParent =new File(file.getParent());
fileParent.mkdirs();
}
原文地址:https://www.cnblogs.com/chenjfblog/p/7524617.html