In Java, I\'m dynamically creating a set of files and I\'d like to change the file permissions on these files on a linux/unix file system. I\'d like to be able to execute t
simple java code for change file permission in java
String path="D:\\file\\read.txt";
File file=new File(path);
if (file.exists()) {
System.out.println("read="+file.canRead());
System.out.println("write="+file.canWrite());
System.out.println("Execute="+file.canExecute());
file.setReadOnly();
}
Reference : how to change file permission in java