質問

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