How To Change File Permission Using Java

In last tutorial we learn How To Check File Permissions In Java ,Now We learn how to change file permission using java code. now firstly we create a file and check its permission

Now we use this java code

 public class ChangeFilePermission {

public static void main(String[] args) {
String path=”D:\file\read.txt”;
File file=new File(path);
if (file.exists()) {


Now we again check file permission.Definitely it will as …


Leave a Reply

Your email address will not be published. Required fields are marked *

+ 77 = 79