Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
通过使用junit测试用例如何检查特定文件是否存在于指定位置?
您可以创建一个检查以下内容的测试:
新文件(文件路径).exists()
如果它的错误只是抛出一个异常
你应该看看 File Class