Java 复制文件后如何删除open access?

Java 复制文件后如何删除open access?,java,file,Java,File,我想在复制文件后删除open access,并在执行某些任务后再次撤消访问权限 File srcfile = Paths.get(source, fileName).toFile(); File destFile = Paths.get(destination, fileName).toFile(); Boolean bool = destFile.setExecutable(false); Bool总是返回false对于您所说的“删除开放访问”是什么意思,我有点困惑。您的意思是要限制用户的打

我想在复制文件后删除open access,并在执行某些任务后再次撤消访问权限

File srcfile = Paths.get(source, fileName).toFile();
File destFile = Paths.get(destination, fileName).toFile();
Boolean bool = destFile.setExecutable(false);

Bool总是返回false

对于您所说的“删除开放访问”是什么意思,我有点困惑。您的意思是要限制用户的打开、读取和写入权限,比如使用
java.security
命名空间?我们需要更多的信息,你需要更具体。顺便说一句,你在代码中把文件复制到哪里了?