Class JNLPPolicy

java.lang.Object
java.security.Policy
net.sourceforge.jnlp.runtime.JNLPPolicy

public class JNLPPolicy extends Policy
Policy 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 Details

    • LOG

      private static final Logger LOG
    • shellSource

      private static CodeSource shellSource
      classes from this source have all permissions
    • systemSource

      private static CodeSource systemSource
      classes from this source have all permissions
    • systemPolicy

      private static Policy systemPolicy
      the previous policy
    • jreExtDir

      private final URI jreExtDir
    • systemJnlpPolicy

      private Policy systemJnlpPolicy
      the system level policy for jnlps
    • userJnlpPolicy

      private Policy userJnlpPolicy
      the user-level policy for jnlps
  • Constructor Details

    • JNLPPolicy

      protected JNLPPolicy()
  • Method Details

    • getPermissions

      public PermissionCollection getPermissions(CodeSource source)
      Return a mutable, heterogeneous-capable permission collection for the source.
      Overrides:
      getPermissions in class Policy
    • refresh

      public void refresh()
      Refresh.
      Overrides:
      refresh in class Policy
    • getAllPermissions

      private Permissions getAllPermissions()
      Return an all-permissions collection.
    • isSystemJar

      private boolean isSystemJar(CodeSource source)
      Returns true if the CodeSource corresponds to a system jar. That is, it's part of the JRE.
    • getPolicyFromConfig

      private Policy getPolicyFromConfig(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 Policy getPolicyFromUrl(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(ProtectionDomain domain, Permission permission)
      Overrides:
      implies in class Policy