How to change image permission mode to 777 using Java code?

前端 未结 5 1555
野趣味
野趣味 2021-01-12 08:13

I want to give permissions mode value \"777\" to image file using Java code. How can I give that using Java? Because I can\'t delete the image with default permission mode \

5条回答
  •  执笔经年
    2021-01-12 09:04

    You can create a File object associated with the file then change permissions using setExecutable, setReadable, and setWritable. Naturally, these operations will fail if your program doesn't have permission to change access permissions for the file.

提交回复
热议问题