Вопрос

I want to create a text file using java which is write protected so that no body can make changes to it.

Это было полезно?

Решение

You can use the setReadOnly() method of File:

File f = new File("/path/to/file");
f.setReadOnly();
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top