Package org.elasticsearch.bootstrap
Class PolicyUtil
java.lang.Object
org.elasticsearch.bootstrap.PolicyUtil
public class PolicyUtil
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description PolicyUtil()
-
Method Summary
Modifier and Type Method Description static java.util.Map<java.lang.String,java.net.URL>
getCodebaseJarMap(java.util.Set<java.net.URL> urls)
Return a map from codebase name to codebase url of jar codebases used by ES core.static PluginPolicyInfo
getModulePolicyInfo(java.nio.file.Path moduleRoot, java.nio.file.Path tmpDir)
Return info about the security policy for a module.static PluginPolicyInfo
getPluginPolicyInfo(java.nio.file.Path pluginRoot, java.nio.file.Path tmpDir)
Return info about the security policy for a plugin.static java.util.Set<java.security.Permission>
getPolicyPermissions(java.net.URL url, java.security.Policy policy, java.nio.file.Path tmpDir)
Return permissions for a policy that apply to a jar.static java.security.Policy
readPolicy(java.net.URL policyFile, java.util.Map<java.lang.String,java.net.URL> codebases)
Reads and returns the specifiedpolicyFile
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PolicyUtil
public PolicyUtil()
-
-
Method Details
-
getCodebaseJarMap
public static java.util.Map<java.lang.String,java.net.URL> getCodebaseJarMap(java.util.Set<java.net.URL> urls)Return a map from codebase name to codebase url of jar codebases used by ES core. -
readPolicy
public static java.security.Policy readPolicy(java.net.URL policyFile, java.util.Map<java.lang.String,java.net.URL> codebases)Reads and returns the specifiedpolicyFile
.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(java.nio.file.Path pluginRoot, java.nio.file.Path tmpDir) throws java.io.IOExceptionReturn info about the security policy for a plugin.- Throws:
java.io.IOException
-
getModulePolicyInfo
public static PluginPolicyInfo getModulePolicyInfo(java.nio.file.Path moduleRoot, java.nio.file.Path tmpDir) throws java.io.IOExceptionReturn info about the security policy for a module.- Throws:
java.io.IOException
-
getPolicyPermissions
public static java.util.Set<java.security.Permission> getPolicyPermissions(java.net.URL url, java.security.Policy policy, java.nio.file.Path tmpDir) throws java.io.IOExceptionReturn permissions for a policy that apply to a jar.- Parameters:
url
- The url of a jar to find permissions for, ornull
for global permissions.- Throws:
java.io.IOException
-