- @SuppressWarnings({ "rawtypes", "unchecked" })
- private static void readProps() throws PAPException {
- InputStream in;
- pdpProp = new Properties();
- try {
- in = new FileInputStream(pdpPath.toFile());
- oldModified = pdpPath.toFile().lastModified();
- pdpProp.load(in);
- } catch (IOException e) {
- PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, "CheckPDP", "Cannot load the Properties file");
- throw new PAPException("Cannot Load the Properties file", e);
- }
- // Read the Properties and Load the PDPs and encoding.
- pdpMap = new HashMap<>();
- // Check the Keys for PDP_URLs
- Collection<Object> unsorted = pdpProp.keySet();
- List<String> sorted = new ArrayList(unsorted);
- Collections.sort(sorted);
- for (String propKey : sorted) {
- if (propKey.startsWith("PDP_URL")) {
- String check_val = pdpProp.getProperty(propKey);
- if (check_val == null) {
- throw new PAPException("Properties file doesn't have the PDP_URL parameter");
- }
- if (check_val.contains(";")) {
- List<String> pdp_default = new ArrayList<>(Arrays.asList(check_val.split("\\s*;\\s*")));
- int pdpCount = 0;
- while (pdpCount < pdp_default.size()) {
- String pdpVal = pdp_default.get(pdpCount);
- readPDPParam(pdpVal);
- pdpCount++;
- }
- } else {
- readPDPParam(check_val);
- }
- }
- }
- if (pdpMap == null || pdpMap.isEmpty()) {
- logger.debug(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Cannot Proceed without PDP_URLs");
- throw new PAPException(XACMLErrorConstants.ERROR_SYSTEM_ERROR +"Cannot Proceed without PDP_URLs");
- }
- }
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ private static void readProps() throws PAPException {
+ InputStream in;
+ pdpProp = new Properties();
+ try {
+ in = new FileInputStream(pdpPath.toFile());
+ oldModified = pdpPath.toFile().lastModified();
+ pdpProp.load(in);
+ } catch (IOException e) {
+ PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, "CheckPDP", "Cannot load the Properties file");
+ throw new PAPException("Cannot Load the Properties file", e);
+ }
+ // Read the Properties and Load the PDPs and encoding.
+ pdpMap = new HashMap<>();
+ // Check the Keys for PDP_URLs
+ Collection<Object> unsorted = pdpProp.keySet();
+ List<String> sorted = new ArrayList(unsorted);
+ Collections.sort(sorted);
+ for (String propKey : sorted) {
+ if (propKey.startsWith("PDP_URL")) {
+ String check_val = pdpProp.getProperty(propKey);
+ if (check_val == null) {
+ throw new PAPException("Properties file doesn't have the PDP_URL parameter");
+ }
+ if (check_val.contains(";")) {
+ List<String> pdp_default = new ArrayList<>(Arrays.asList(check_val.split("\\s*;\\s*")));
+ int pdpCount = 0;
+ while (pdpCount < pdp_default.size()) {
+ String pdpVal = pdp_default.get(pdpCount);
+ readPDPParam(pdpVal);
+ pdpCount++;
+ }
+ } else {
+ readPDPParam(check_val);
+ }
+ }
+ }
+ if (pdpMap == null || pdpMap.isEmpty()) {
+ logger.debug(XACMLErrorConstants.ERROR_SYSTEM_ERROR + "Cannot Proceed without PDP_URLs");
+ throw new PAPException(XACMLErrorConstants.ERROR_SYSTEM_ERROR +"Cannot Proceed without PDP_URLs");
+ }
+ }