The students in my beginning Java class are beginning to learn about file I/O, and one of their projects involves deleting and renaming files. I can think of dozens of ways this can go wrong.
Therefore, it would be useful to use Java's security framework to restrict their programs from renaming, deleting, or writing over files that are not contained in a specific directory. Reading outside the directory is fine, and the policy doesn't need to be super-bulletproof -- this is more about preventing accidental damage than protecting against maliciousness on the part of my students.
However, I haven't done any real Java work outside the domain of programming courses at school, so I don't know how to write or activate policy files. What is a simple policy file I can use to achieve this, and how would I activate it when running my students' code?