Given the following class, which statement is correct? A. The class does not contain any security issues.
Question:
Given the following class, which statement is correct?
A. The class does not contain any security issues.
B. The class contains exactly one security issue.
C. The class contains exactly two security issues.
D. The class contains exactly three security issues.
E. None of the above.
Transcribed Image Text:
1: import java.security.*; 2: import java.util.*; 3: 4: public class SecretFile { private String secret; 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: // Constructors/Getters Omitted private static class Folder { private final SecretFile value; private final Permission permission; } // Constructors/Getters Omitted public static Permission getPermission (String check) { // Implementation Omitted } private static Map c= new HashMap (); public static SecretFile getSecret (String t) { var securityRecord = c.get (t); if (securityRecord != null) { return securityRecord.getValue(); } var p= getPermission (t); Access Controller.checkPermission (p); var pc = p.newPermission Collection(); pc.add(p); var secret = Access Controller.doPrivileged ( new PrivilegedAction () { public SecretFile run() { return new SecretFile(System.getProperty(t)); }} }}, new Access ControlContext(new ProtectionDomain[] { new ProtectionDomain (null, pc) })); c.put(t, new Folder (secret, p)); return secret;
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (QA)
The provided code snippet is from a Java class that seems to be dealing with a securityrelated feature managing access to SecretFile objects with perm...View the full answer
Answered By
Collins Omondi
I have been an academic and content writer for at least 6 years, working on different academic fields including accounting, political science, technology, law, and nursing in addition to those earlier listed under my education background.
I have a Bachelor’s degree in Commerce (Accounting option), and vast knowledge in various academic fields Finance, Economics, Marketing, Management, Social Science, Women and Gender, Business law, and Statistics among others.
4.80+
4+ Reviews
16+ Question Solved
Related Book For
OCP Oracle Certified Professional Java SE 11 Developer Practice Tests Exam 1Z0 819 And Upgrade Exam 1Z0 817
ISBN: 9781119696131
1st Edition
Authors: Scott Selikoff, Jeanne Boyarsky
Question Posted:
Students also viewed these Computer science questions
-
What is the appropriate manner for a HR professional to transition to the strategic role as executive partner on HR related issues?
-
Which of these are helpful in improving your affective forecasting ability? Group of answer choices Asking for advice from someone with relevant experience Relying on your own experience Trying to...
-
Draw the BST that results when you insert the keys E A S Y QUE S T I O N in that order into an initially empty tree. What is the height of the resulting BST?
-
Define the term software as a service (SaaS). What are some of the advantages and disadvantages of employing a SaaS? What precautions might you take to minimize the risk of using one?
-
Flower Company started doing business on January 1, 20X0. For the year ended December 31, 20X1, it reported $450,000 pre-tax book income on its income statement. Flower is subject to a 21% corporate...
-
Spratley Ltd is a builders merchant. On 1 September the business had, as part of its inventories, 20 tonnes of sand at a cost of 18 per tonne and, therefore, at a total cost of 360. During the first...
-
The Zwatch Company manufactures trendy, high- quality moderately priced watches. As Zwatchs senior financial analyst, you are asked to recommend a method of inventory costing. The CFO will use your...
-
12. Use the diagram below of circle A, where AE = 4 and DE 1 CB to answer parts a-c. a) **Determine the sector area of ACD in terms of . (2 points) (etaloq 41 mol uniwellorad b) Determine the...
-
How many objects are eligible for garbage collection immediately before the end of the main() method? A. None. B. One. C. Two. D. Three. E. The code does not compile. F. None of the above. public...
-
Which of the following are JDBC interfaces in the java.sql package? A. Driver, Query B. Driver, ResultSet C. DriverManager, Query D. DriverManager, ResultSet E. Driver, DriverManager, Query F....
-
Retep Ltd hired a drilling machine for use on job 160. The machine was not used on any other job. Which of the following statements is true? A. Rent of the machine will be charged as a direct expense...
-
what role does a healthcare manager play in strategic planning issues and how does stakeholders impact strategic planning? Explain
-
How do networks of influence operate within the realm of academia and research, and what implications do they have for the dissemination of knowledge and the advancement of scientific discourse?
-
Struggling to understand Job Costing vs Product costing as it relates to certain companies. I feel good about continuous (process) costing, but what would it be in this example: Toyota Motor...
-
If they are investing, say, 1 million in a euro deposit at 3.42% per annum versus investing that identical amount in a yen deposit at 0.6948% per annum, they can cover for foreign exchange risk by...
-
Precision Tools Manufacturing (PTM) has four categories of overhead. The four categories and the expected overhead costs for each category for the year are as follows: Maintenance $140,000 Materials...
-
Explain how translating a foreign balance sheet for inclusion in a multinationals domestic balance sheet can violate the accounting identity.
-
On January 1, 2017, McIlroy, Inc., acquired a 60 percent interest in the common stock of Stinson, Inc., for $340,200. Stinson's book value on that date consisted of common stock of $100,000 and...
-
What additional factors must you consider during the information-level design of a distributed database?
-
What additional factors must you consider during the physical-level design of a distributed database?
-
What is the difference between a file server and a client/server system?
-
Harley has two lines of businessa manufacturing/retail operation and a finance subsidiary. Harley's dealers are independent of Harley and sell motorcycles and related products (e.g. Harley apparel)....
-
Autumn Manufacturing mass produces its product in three departments. A cost analysis for Department 1, the first department in the manufacturing cycle for the month of April, can be found in the...
-
Based on the? accounts, create the journal entries that resulted from the six transactions. Include explanations with each journal entry. Cash Supplies Building Equipment (1) 35,000 (4) 10,000 (2)...
Study smarter with the SolutionInn App