public static boolean isWritable(String filePath)
{
boolean canWrite=false;
File f=FileSystemView.getFileSystemView().createFileObject(filePath+"/test.init");
if(!f.exists())
{
try
{
if(f.createNewFile())
{
canWrite=true;
f.delete();
}
}
catch (IOException e)
{
}
}
else
{
if(f.renameTo(f))
canWrite=true;
}
return canWrite;
}
目录是否可写入
最新推荐文章于 2024-03-14 11:32:09 发布