【发布时间】:2013-02-27 15:39:55
【问题描述】:
在 Windows 上的 Java 中,我们如何知道文件或文件夹是否被读保护?
我尝试使用 canRead() 和 setReadable() :
String pathFile = "D:/Folder";
File f = new File(pathFile);
System.out.println("Is Protected => " + f.setReadable(true)==true);
但这并不能解决我的问题
谢谢
【问题讨论】:
-
你能澄清一下 canRead() 是如何解决你的问题的吗?