{
super.init(props);
String file = props.getProperty(PARAM_KEYFILE);
if (file == null) {
String msg = sm.getString("filerealm.nofile");
throw new BadRealmException(msg);
}
if (file.contains("$")) {
file = RelativePathResolver.resolvePath(file);
}
this.setProperty(PARAM_KEYFILE, file);
String jaasCtx = props.getProperty(IASRealm.JAAS_CONTEXT_PARAM);
if (jaasCtx == null) {
String msg = sm.getString("filerealm.nomodule");
throw new BadRealmException(msg);
}
this.setProperty(IASRealm.JAAS_CONTEXT_PARAM, jaasCtx);
_logger.log(Level.FINE, "FileRealm : "+ PARAM_KEYFILE + "={0}", file);
_logger.log(Level.FINE, "FileRealm : "+ IASRealm.JAAS_CONTEXT_PARAM + "={0}", jaasCtx);
try {
if (Util.isEmbeddedServer()) {
String embeddedFilePath = Util.writeConfigFileToTempDir(file).getAbsolutePath();
file = embeddedFilePath;
}
helper = new FileRealmHelper(file);
} catch (IOException ioe) {
String msg = sm.getString("filerealm.noaccess", ioe.toString());
throw new BadRealmException(msg);
}
}