Java Files set posix attribute
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.PosixFilePermission; public class Main { public static void main(String[] args) { Path path = Paths.get("home/docs/users.txt"); try {//from w w w. j ava2 s . co m Files.setAttribute(path, "posix:permission", PosixFilePermission.OTHERS_WRITE); } catch (IOException ex) { ex.printStackTrace(); } } }