直接粘代码:
/**
* 判断文件是否存在
*
* @Title: isExcite
* @param @param filePath
* @param @return
* @return boolean 返回类型
* @throws
*/
public static boolean isExcite(String filePath) {
File file = new File(filePath);
// 如果文件夹不存在则创建
if (!file.exists() && !file.isDirectory()) {
return false;
} else {
return true;
}
}