fileutil工具类 处理文件流工具
private static File file;
/**
* 判断文件是否存在
*
* @param path
* 文件路径
* @return boolean
*/
public static boolean fileIsExists(String path) {
if (path == null)
return false;
file = new File(path);
return file.exists();
}
/**
* 判断服务器文件是否存在
*
* @param path
* 文件路径
* @param request
* HttpServletRequest
* @return boolean
*/
public static boolean fileIsExists(String path, HttpServletRequest request) {
if (path == null)
return false;
file = new File(request.getServletContext().getRealPath(path));
return file.exists();
}