也许最简单的方法是:
String dirPath = "path/to/directory";
String fileName = "foo.txt";
boolean fileExistsInDir = new File( dirPath, fileName ).exists();
Run Code Online (Sandbox Code Playgroud)
文件只是文件系统中某个位置的占位符.该位置不一定存在.
| 归档时间: |
|
| 查看次数: |
442 次 |
| 最近记录: |