use of java.security.URIParameter in project jstorm by alibaba.
the class AuthUtils method GetConfiguration.
/**
* Construct a JAAS configuration object per storm configuration file
*
* @param storm_conf Storm configuration
* @return JAAS configuration object
*/
public static Configuration GetConfiguration(Map storm_conf) {
Configuration login_conf = null;
// find login file configuration from Storm configuration
String loginConfigurationFile = (String) storm_conf.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;
}
use of java.security.URIParameter in project jdk8u_jdk by JetBrains.
the class ConfigFileWithBlank method main.
public static void main(String[] args) throws Exception {
File f = new File("a b c");
FileOutputStream fos = new FileOutputStream(f);
fos.write("".getBytes());
fos.close();
System.err.println(f.toURI());
try {
Configuration.getInstance("JavaLoginConfig", new URIParameter(f.toURI()));
} finally {
f.delete();
}
}
Aggregations