* @param papEngine
*/
public Set<StdPDPGroup> checkGroupsToPush(String policyToCreateUpdate, PAPPolicyEngine papEngine) {
- Set<StdPDPGroup> changedGroups= new HashSet<StdPDPGroup>();
+ Set<StdPDPGroup> changedGroups= new HashSet<>();
// Check if the file has been modified. then re-load the properties file.
newModified = propFile.lastModified();
try {
StdPDPPolicy policy = new StdPDPPolicy(policyId, true, policyName, null);
//Get the current policies from the Group and Add the new one
Set<PDPPolicy> currentPoliciesInGroup = pdpGroup.getPolicies();
- Set<PDPPolicy> policies = new HashSet<PDPPolicy>();
- if(policy!=null){
- policies.add(policy);
- }
+ Set<PDPPolicy> policies = new HashSet<>();
+ policies.add(policy);
pdpGroup.copyPolicyToFile(policyId, new FileInputStream(Paths.get(policyToCreateUpdate).toFile()));
//If the selected policy is in the group we must remove it because the name is default
Iterator<PDPPolicy> policyIterator = policies.iterator();