判断该目录下是否存在某个文件
2015-08-12 10:42
211 查看
String dirPath = request.getSession().getServletContext().getRealPath("/template/html");
File path = new File(dirPath);
if(!path.exists()) path.mkdirs();
//生成的文件的名字
String indexFileName = id+".html";
//判断是否已经存在该html文件,存在了就直接访问html ,不存在生成html文件
String[] indexfileList = path.list(new DirectoryFilter(indexFileName));
相关文章推荐
- shell判断文件,目录是否存在或者具有权限
- 在Shell里面判断字符串是否为空 ,文件存在,目录存在
- C/C++判断某一文件或目录是否存在
- VC中判断目录,文件是否存在,创建目录的方法
- Go语言编程中判断文件是否存在是创建目录的方法
- [zz] shell判断文件,目录是否存在或者具有权限
- linux C之判断文件或目录是否存在 access函数
- 上传sftp,创建20171024目录,判断目录是否存在,复制文件,判断文件字符集
- File.exists()判断文件是否存在,File.isDirectory()判断目录是否存在
- Python 判断文件或目录是否存在的实例代码
- 判断文件、目录是否存在:C、C++、Windows API、 boost
- Linux shell判断文件或目录是否存在
- Windows下使用_access和_stat判断文件和目录是否存在的区别
- 如何列出某个目录下的所有子目录? 3)如何判断一个文件或目录是否存在? 4)如何读写文件?
- c++判断文件是否存在,判断是文件还是目录,获取文件大小,获取程序所在路径
- C#文件读写追加创建目录,判断目录是否存在等操作
- 判断文件、目录是否存在:C、C++、Windows API、 boost
- ios6.1&ios7&ios9判断沙盒文件或者目录是否存在,以及判断是文件还是目录的一个隐藏问题
- C/C++中判断某一文件或目录是否存在
- Shell脚本执行hive语句 | hive以日期建立分区表 | linux schedule程序 | sed替换文件字符串 | shell判断hdfs文件目录是否存在