1Z0-829 Java I/O API and Securing Applications Practice Question
Exhibit
grant codeBase "file:${user.home}/lib/*" {
permission java.io.FilePermission "${user.home}/config.ini", "read";
permission java.io.FilePermission "${user.home}/logs/-", "read,write";
// Missing permission for data files
};
grant codeBase "file:/app/lib/app.jar" {
permission java.security.AllPermission;
};Refer to the exhibit. A security policy file is configured as shown. The application in app.jar tries to read a file named "${user.home}/data/db.properties". What is the result?
⚠ Common exam trap
The trap here is that candidates focus on the specific FilePermission grants and miss that AllPermission in the second grant renders all other permission checks irrelevant, leading them to incorrectly choose options based on path mismatches.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Access is allowed because app.jar has AllPermission.
The security policy grants AllPermission to app.jar, which supersedes any specific file permissions. AllPermission implies every possible permission, including read access to any file, regardless of path restrictions. Therefore, the application can read '${user.home}/data/db.properties' without denial.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Access is denied because the FilePermission for data files is missing.
Why it's wrong here
The first grant does not cover app.jar.
- ✗
Access is denied because app.jar's AllPermission is not sufficient.
Why it's wrong here
AllPermission grants everything.
- ✗
Access is allowed because the first grant includes read permission for logs/-, which covers data.
Why it's wrong here
logs/- does not include data/.
- ✓
Access is allowed because app.jar has AllPermission.
Why this is correct
AllPermission overrides any restrictions.
Go deeper
Related to this question
About these practice questions
One of 513 original 1Z0-829 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.