List of usage examples for java.security URIParameter URIParameter
public URIParameter(java.net.URI uri)
From source file:org.apache.storm.security.auth.AuthUtils.java
/** * Construct a JAAS configuration object per storm configuration file * @param topoConf Storm configuration/* w w w . j a va 2 s.c o m*/ * @return JAAS configuration object */ public static Configuration GetConfiguration(Map<String, Object> topoConf) { Configuration login_conf = null; //find login file configuration from Storm configuration String loginConfigurationFile = (String) topoConf.get("java.security.auth.login.config"); if ((loginConfigurationFile != null) && (loginConfigurationFile.length() > 0)) { File config_file = new File(loginConfigurationFile); if (!config_file.canRead()) { throw new RuntimeException("File " + loginConfigurationFile + " cannot be read."); } try { URI config_uri = config_file.toURI(); login_conf = Configuration.getInstance("JavaLoginConfig", new URIParameter(config_uri)); } catch (Exception ex) { throw new RuntimeException(ex); } } return login_conf; }
From source file:org.apache.storm.security.auth.ClientAuthUtils.java
/** * Construct a JAAS configuration object per storm configuration file * * @param topoConf Storm configuration/*from w w w.jav a2s . c om*/ * @return JAAS configuration object */ public static Configuration getConfiguration(Map<String, Object> topoConf) { Configuration login_conf = null; //find login file configuration from Storm configuration String loginConfigurationFile = (String) topoConf.get("java.security.auth.login.config"); if ((loginConfigurationFile != null) && (loginConfigurationFile.length() > 0)) { File config_file = new File(loginConfigurationFile); if (!config_file.canRead()) { throw new RuntimeException("File " + loginConfigurationFile + " cannot be read."); } try { URI config_uri = config_file.toURI(); login_conf = Configuration.getInstance("JavaLoginConfig", new URIParameter(config_uri)); } catch (Exception ex) { throw new RuntimeException(ex); } } return login_conf; }