/** * Reads the XACML XML policy file in and returns the version contained in the root Policy/PolicySet element. * * @param policy - The policy file. * @return - The version string from the file (uninterpreted) * @throws IOException */ public static String getVersion(Path policy) throws IOException { Object data = null; try (InputStream is = Files.newInputStream(policy)) { data = XACMLPolicyScanner.readPolicy(is); } catch (IOException e) { logger.error("Failed to read policy", e); throw e; } if (data == null) { logger.warn("Version is null."); return null; } return getVersion(data); }
/** * Reads the XACML XML policy file in and returns the version contained in the root Policy/PolicySet element. * * @param policy - The policy file. * @return - The version string from the file (uninterpreted) * @throws IOException */ public static String getVersion(Path policy) throws IOException { Object data = null; try (InputStream is = Files.newInputStream(policy)) { data = XACMLPolicyScanner.readPolicy(is); } catch (IOException e) { logger.error("Failed to read policy", e); throw e; } if (data == null) { logger.warn("Version is null."); return null; } return getVersion(data); }
this.isValid = false; } else { this.version = versionStringToArray(XACMLPolicyScanner.getVersion(rootElement)); if (rootElement instanceof PolicySetType) { this.policyId = ((PolicySetType)rootElement).getPolicySetId();
this.isValid = false; } else { this.version = versionStringToArray(XACMLPolicyScanner.getVersion(rootElement)); if (rootElement instanceof PolicySetType) { this.policyId = ((PolicySetType)rootElement).getPolicySetId();