8012261: update policytool to support java.net.HttpURLPermission
authorweijun
Sat, 18 May 2013 10:15:06 +0800
changeset 17692 685c0741cfbb
parent 17691 13931cd9405f
child 17697 7ba520729c40
8012261: update policytool to support java.net.HttpURLPermission Reviewed-by: mullan
jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java
jdk/src/share/classes/sun/security/tools/policytool/Resources.java
--- a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Fri May 17 12:04:18 2013 -0700
+++ b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Sat May 18 10:15:06 2013 +0800
@@ -1447,6 +1447,7 @@
         PERM_ARRAY.add(new AWTPerm());
         PERM_ARRAY.add(new DelegationPerm());
         PERM_ARRAY.add(new FilePerm());
+        PERM_ARRAY.add(new HttpURLPerm());
         PERM_ARRAY.add(new InqSecContextPerm());
         PERM_ARRAY.add(new LogPerm());
         PERM_ARRAY.add(new MgmtPerm());
@@ -3842,6 +3843,20 @@
     }
 }
 
+class HttpURLPerm extends Perm {
+    public HttpURLPerm() {
+        super("HttpURLPermission",
+                "java.net.HttpURLPermission",
+                new String[]    {
+                    "<"+ PolicyTool.rb.getString("url") + ">",
+                },
+                new String[]    {
+                    "<" + PolicyTool.rb.getString("method.list") + ">:<"
+                        + PolicyTool.rb.getString("request.headers.list") + ">",
+                });
+    }
+}
+
 class InqSecContextPerm extends Perm {
     public InqSecContextPerm() {
     super("InquireSecContextPermission",
--- a/jdk/src/share/classes/sun/security/tools/policytool/Resources.java	Fri May 17 12:04:18 2013 -0700
+++ b/jdk/src/share/classes/sun/security/tools/policytool/Resources.java	Sat May 18 10:15:06 2013 +0800
@@ -139,6 +139,9 @@
         {"policy.type", "policy type"},
         {"property.name", "property name"},
         {"provider.name", "provider name"},
+        {"url", "url"},
+        {"method.list", "method list"},
+        {"request.headers.list", "request headers list"},
         {"Principal.List", "Principal List"},
         {"Permission.List", "Permission List"},
         {"Code.Base", "Code Base"},