aboutsummaryrefslogtreecommitdiffstats
path: root/tests/reproducers/simple/CustomPolicies/srcs/CustomPolicies.java
blob: 2446f55fadb616d33dc3b2d772cf4be24a53416e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.applet.Applet;
import java.security.AccessControlException;

public class CustomPolicies extends Applet {

    @Override
    public void start() {
        System.out.println("CustomPolicies applet read: " + read("user.home"));
        System.exit(0);
    }

    private String read(String key) {
        try {
            return System.getProperty(key);
        } catch (AccessControlException ace) {
            return ace.toString();
        }
    }

    public static void main(String[] args) {
        new CustomPolicies().start();
    }
}