try (OutputStream os = Files.newOutputStream(file)) {
policyProperties.store(os, "");
} catch (Exception e) {
try (OutputStream os = Files.newOutputStream(file)) {
policyProperties.store(os, "");
} catch (Exception e) {
}
//Even if we create a new pip file, we still need to parse and load the properties
try{
this.readPIPProperties(directory, pipProperties);
}catch(Exception e){
}
//Even if we create a new pip file, we still need to parse and load the properties
try{
this.readPIPProperties(directory, pipProperties);
}catch(Exception e){
if (currentPolicy == null) {
PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE + "Policy " + policy.getId() + " does not exist.");
return false;
if (currentPolicy == null) {
PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE + "Policy " + policy.getId() + " does not exist.");
return false;