Package net.sourceforge.jnlp.runtime
Class JNLPPolicy
- java.lang.Object
-
- java.security.Policy
-
- net.sourceforge.jnlp.runtime.JNLPPolicy
-
public class JNLPPolicy extends java.security.PolicyPolicy for JNLP environment. This class delegates to the system policy but always grants permissions to the JNLP code and system CodeSources (no separate policy file needed). This class may also grant permissions to applications at runtime if approved by the user.- Version:
- $Revision: 1.7 $
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.URIjreExtDirprivate static LoggerLOGprivate static java.security.CodeSourceshellSourceclasses from this source have all permissionsprivate java.security.PolicysystemJnlpPolicythe system level policy for jnlpsprivate static java.security.PolicysystemPolicythe previous policyprivate static java.security.CodeSourcesystemSourceclasses from this source have all permissionsprivate java.security.PolicyuserJnlpPolicythe user-level policy for jnlps
-
Constructor Summary
Constructors Modifier Constructor Description protectedJNLPPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.security.PermissionsgetAllPermissions()Return an all-permissions collection.java.security.PermissionCollectiongetPermissions(java.security.CodeSource source)Return a mutable, heterogeneous-capable permission collection for the source.private java.security.PolicygetPolicyFromConfig(java.lang.String key)Constructs a delegate policy based on a config settingprivate java.security.PolicygetPolicyFromUrl(java.lang.String policyLocation)Loads a policy from a URIbooleanimplies(java.security.ProtectionDomain domain, java.security.Permission permission)private booleanisSystemJar(java.security.CodeSource source)Returns true if the CodeSource corresponds to a system jar.voidrefresh()Refresh.
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
shellSource
private static java.security.CodeSource shellSource
classes from this source have all permissions
-
systemSource
private static java.security.CodeSource systemSource
classes from this source have all permissions
-
systemPolicy
private static java.security.Policy systemPolicy
the previous policy
-
jreExtDir
private final java.net.URI jreExtDir
-
systemJnlpPolicy
private java.security.Policy systemJnlpPolicy
the system level policy for jnlps
-
userJnlpPolicy
private java.security.Policy userJnlpPolicy
the user-level policy for jnlps
-
-
Method Detail
-
getPermissions
public java.security.PermissionCollection getPermissions(java.security.CodeSource source)
Return a mutable, heterogeneous-capable permission collection for the source.- Overrides:
getPermissionsin classjava.security.Policy
-
refresh
public void refresh()
Refresh.- Overrides:
refreshin classjava.security.Policy
-
getAllPermissions
private java.security.Permissions getAllPermissions()
Return an all-permissions collection.
-
isSystemJar
private boolean isSystemJar(java.security.CodeSource source)
Returns true if the CodeSource corresponds to a system jar. That is, it's part of the JRE.
-
getPolicyFromConfig
private java.security.Policy getPolicyFromConfig(java.lang.String key)
Constructs a delegate policy based on a config setting- Parameters:
key- a KEY_* in DeploymentConfiguration- Returns:
- a policy based on the configuration set by the user
-
getPolicyFromUrl
private java.security.Policy getPolicyFromUrl(java.lang.String policyLocation)
Loads a policy from a URI- Parameters:
policyLocation- the URI of the policy- Returns:
- a policy based on the configuration set by the user
-
implies
public boolean implies(java.security.ProtectionDomain domain, java.security.Permission permission)- Overrides:
impliesin classjava.security.Policy
-
-