try {
m_validateObjectPoliciesFromDatastream =
Boolean.parseBoolean(moduleParameters
.get(VALIDATE_OBJECT_POLICIES_FROM_DATASTREAM_KEY));
} catch (Exception e) {
throw new GeneralException("bad init parm boolean value for "
+ VALIDATE_OBJECT_POLICIES_FROM_DATASTREAM_KEY,
e);
}
} else {
m_validateObjectPoliciesFromDatastream = false;
}
// Initialize the policy parser given the POLICY_SCHEMA_PATH_KEY
if (moduleParameters.containsKey(POLICY_SCHEMA_PATH_KEY)) {
String schemaPath = moduleParameters.get(POLICY_SCHEMA_PATH_KEY);
File schema;
if (schemaPath.startsWith(File.separator)){ // absolute
schema = new File(schemaPath);
} else {
schema = new File(new File(m_serverHome), schemaPath);
}
try {
FileInputStream in = new FileInputStream(schema);
m_policyParser = new PolicyParser(in);
ValidationUtility.setPolicyParser(m_policyParser);
} catch (Exception e) {
throw new GeneralException("Error loading policy"
+ " schema: " + schema.getAbsolutePath(), e);
}
} else {
throw new GeneralException("Policy schema path not"
+ " specified. Must be given as " + POLICY_SCHEMA_PATH_KEY);
}
m_repositoryPolicies = new ArrayList<AbstractPolicy>();
}