1 18 19 package org.netbeans.modules.apisupport.jnlplauncher; 20 21 import java.security.*; 22 23 28 class RuntimePolicy extends Policy { 29 30 private static PermissionCollection permissions; 31 32 private static synchronized PermissionCollection getAllPermissionCollection() { 33 if (permissions == null) { 34 permissions = new Permissions(); 35 permissions.add(new AllPermission()); 36 permissions.setReadOnly(); 37 } 38 return permissions; 39 } 40 41 public PermissionCollection getPermissions(CodeSource codesource) { 42 return getAllPermissionCollection(); 43 } 44 45 public boolean implies(ProtectionDomain domain, Permission permission) { 46 return getPermissions(domain.getCodeSource()).implies(permission); 47 } 48 49 public PermissionCollection getPermissions(ProtectionDomain domain) { 50 return getPermissions(domain.getCodeSource()); 51 } 52 53 public void refresh() { 54 } 55 } 56 | Popular Tags |