"test/policies/interop/xacml-policy3.xml",
"test/policies/interop/xacml-policy4.xml",
"test/policies/interop/xacml-policy5.xml"};
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
XACMLPolicy policySet = null;
try
{
policySet = PolicyFactory.createPolicySet(tcl.getResourceAsStream(policySetLocation),jbf);
}
catch (Exception e1)
{
throw new RuntimeException(e1);
}
List<XACMLPolicy> policyList = new ArrayList<XACMLPolicy>();
for (String str:arr)
{
InputStream is = tcl.getResourceAsStream(str);
if(is == null)
throw new IllegalStateException("Inputstream is null");
try
{
policyList.add(PolicyFactory.createPolicy(is));
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
policySet.setEnclosingPolicies(policyList);
Set<XACMLPolicy> set = new HashSet<XACMLPolicy>();
set.add(policySet);
this.setPolicies(set);
}