| 1 |
class ACLTest { |
| 2 |
|
| 3 |
public static void main(String args[]) { |
| 4 |
ACL acl = new ACL(ACL.DENY); |
| 5 |
|
| 6 |
acl.add(ACL.ALLOW, "*.ukc.ac.uk"); |
| 7 |
acl.add(ACL.ALLOW, "129.12.*"); |
| 8 |
// not really needed if we default to deny :) |
| 9 |
acl.add(ACL.DENY, "*"); |
| 10 |
|
| 11 |
System.out.println(acl.getACL()); |
| 12 |
|
| 13 |
System.out.println("killigrew.ukc.ac.uk: " + acl.check("killigrew.ukc.ac.uk")); |
| 14 |
System.out.println("129.12.41.13: " + acl.check("129.12.41.13")); |
| 15 |
System.out.println("kruskal.18hp.net: " + acl.check("kruskal.18hp.net")); |
| 16 |
System.out.println("192.168.1.1: " + acl.check("192.168.1.1")); |
| 17 |
} |
| 18 |
|
| 19 |
} |