import java.io.File;
public class fileUtils {
/**
* 判断文件是否为空的
* @param file
* @return
*/
public boolean fileIsEmpty(File file) {
//File file = new File("D:\\test.txt");
if (!file.exists() || file.length() == 0) {
//System.out.println("文件为空!");
return true;
} else {
//System.out.println("文件不为空!");
return false;
}
}
}
10-08
519
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交