logger.log(logger.INFO, "FileACL.loaded: "+acs);
}
} catch (Exception e) {
acs = null;
logger.log(Logger.ERROR, e.getMessage(), e);
throw new AccessControlException(Globals.getBrokerResources().getKString(
BrokerResources.X_FAILED_TO_LOAD_ACCESSCONTROL, aclurl) + " - " + e.getMessage());
}
return;
}
String acl_loc = authProps.getProperty(
AccessController.PROP_ACCESSCONTROL_PREFIX
+ PROP_DIRPATH_SUFFIX, Globals.getInstanceEtcDir());
aclfname = authProps.getProperty(
AccessController.PROP_ACCESSCONTROL_PREFIX
+ PROP_FILENAME_SUFFIX, DEFAULT_ACL_FILENAME);
if (aclfname == null) {
String emsg = Globals.getBrokerResources().getKString(
BrokerResources.X_ACCESSCONTROL_NOT_DEFINED, type);
logger.log(Logger.ERROR, emsg);
throw new AccessControlException(emsg);
}
String aclfile = acl_loc +File.separator + aclfname;
File file = null;
long timestamp = 0L;
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
file = new File(aclfile);
timestamp = file.lastModified();
if (acs != null && aclfileSave != null && aclfile.equals(aclfileSave)) {
if (timestamp > 0 && timestamp == acsTimestamp) {
return;
}
}
if (DEBUG) {
logger.log(logger.INFO, "Loading access control "+aclfile + " ...");
}
acs = new Properties();
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
acs.load(bis);
bis.close();
fis.close();
checkVersion(acs, aclfile, true);
aclfileSave = aclfile;
acsTimestamp = timestamp;
} catch (IOException e) {
acs = null;
try {
if (bis != null) bis.close();
if (fis != null) fis.close();
} catch (IOException ioe) {}
logger.log(Logger.ERROR, e.getMessage(), e);
throw new AccessControlException(Globals.getBrokerResources().getKString(
BrokerResources.X_FAILED_TO_LOAD_ACCESSCONTROL, aclfile) + " - " + e.getMessage());
}
}