X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Frest%2Futil%2FWebapps.java;h=1fb8ec531a657a57eef7e9acee481fdca3e22489;hp=908078f7359bc6ba7098ec55ce26c8936ff7ae86;hb=80f072f60509ef3a35369a60857fe05f6c2a993a;hpb=c53fa990ea27ec074859eb94bcb7ec6deaa2157b diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/Webapps.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/Webapps.java index 908078f73..1fb8ec531 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/Webapps.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/Webapps.java @@ -30,6 +30,8 @@ import org.apache.commons.logging.LogFactory; import org.onap.policy.rest.XACMLRestProperties; import org.onap.policy.xacml.api.XACMLErrorConstants; + +import com.att.research.xacml.api.pap.PAPException; import com.att.research.xacml.util.XACMLProperties; import org.onap.policy.common.logging.eelf.MessageCodes; @@ -46,8 +48,8 @@ public class Webapps { public static String getConfigHome(){ try { loadWebapps(); - } catch (Exception e) { - logger.error("Exception Occured while loading webapps"+e); + } catch (PAPException e) { + logger.error("Exception Occured while loading webapps",e); return null; } return configHome; @@ -56,14 +58,14 @@ public class Webapps { public static String getActionHome(){ try { loadWebapps(); - } catch (Exception e) { - logger.error("Exception Occured while loading webapps"+e); + } catch (PAPException e) { + logger.error("Exception Occured while loading webapps",e); return null; } return actionHome; } - private static void loadWebapps() throws Exception{ + private static void loadWebapps() throws PAPException{ String errorMessageName = "Invalid Webapps Path Location property :"; if(actionHome == null || configHome == null){ Path webappsPath = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WEBAPPS)); @@ -71,7 +73,7 @@ public class Webapps { if (webappsPath == null) { logger.error(errorMessageName + XACMLRestProperties.PROP_PAP_WEBAPPS); PolicyLogger.error(errorMessageName + XACMLRestProperties.PROP_PAP_WEBAPPS); - throw new Exception(errorMessageName + XACMLRestProperties.PROP_PAP_WEBAPPS); + throw new PAPException(errorMessageName + XACMLRestProperties.PROP_PAP_WEBAPPS); } Path webappsPathConfig; Path webappsPathAction;