changeset 7197:0f7aaabed25f

8012261: update policytool to support java.net.HttpURLPermission Reviewed-by: mullan
author weijun
date Sat, 18 May 2013 10:15:06 +0800
parents 3b1450ee2bb9
children b9b26b424bfc
files src/share/classes/sun/security/tools/policytool/PolicyTool.java src/share/classes/sun/security/tools/policytool/Resources.java
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Fri May 17 12:04:18 2013 -0700
+++ b/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/src/share/classes/sun/security/tools/policytool/Resources.java	Fri May 17 12:04:18 2013 -0700
+++ b/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"},