dcsimg

How to make a file read only?

John Zukowski

For any type of file, just use the setReadOnly() method of File to mark a file as read-only. There is no argument to make it writable once it is read-only.