File的API中前三个方法就是: canExecute() Tests whether the application can execute the file denoted by this abstract pathname. boolean canRead() Tests whether the application can read the file denoted by this abstract pathname. boolean canWrite() Tests whether the application can modify the file denoted by this abstract pathname.
由你指定的文件构建一个File对象.
调用File里面的方法 可以知道此文件 是否可以访问等其他有用的信息.
具体参考下API.
canExecute()
Tests whether the application can execute the file denoted by this abstract pathname.
boolean canRead()
Tests whether the application can read the file denoted by this abstract pathname.
boolean canWrite()
Tests whether the application can modify the file denoted by this abstract pathname.