Class PolicyUtil

java.lang.Object
org.elasticsearch.bootstrap.PolicyUtil

public class PolicyUtil extends Object
  • Constructor Details

    • PolicyUtil

      public PolicyUtil()
  • Method Details

    • getCodebaseJarMap

      public static Map<String,URL> getCodebaseJarMap(Set<URL> urls)
      Return a map from codebase name to codebase url of jar codebases used by ES core.
    • readPolicy

      public static Policy readPolicy(URL policyFile, Map<String,URL> codebases)
      Reads and returns the specified policyFile.

      Jar files listed in codebases location will be provided to the policy file via a system property of the short name: e.g. ${codebase.joda-convert-1.2.jar} would map to full URL.

    • getPluginPolicyInfo

      public static PluginPolicyInfo getPluginPolicyInfo(Path pluginRoot, Path tmpDir) throws IOException
      Return info about the security policy for a plugin.
      Throws:
      IOException
    • getModulePolicyInfo

      public static PluginPolicyInfo getModulePolicyInfo(Path moduleRoot, Path tmpDir) throws IOException
      Return info about the security policy for a module.
      Throws:
      IOException
    • getPolicyPermissions

      public static Set<Permission> getPolicyPermissions(URL url, Policy policy, Path tmpDir) throws IOException
      Return permissions for a policy that apply to a jar.
      Parameters:
      url - The url of a jar to find permissions for, or null for global permissions.
      Throws:
      IOException