Package com.sun.xacml

Examples of com.sun.xacml.ParsingException


            return Policy.getInstance(root);
        } else if (name.equals("PolicySet")) {
            return PolicySet.getInstance(root, policyFinder);
        } else {
            // this isn't a root type that we know how to handle
            throw new ParsingException("Unknown root document type: " + name);
        }
    }
View Full Code Here


    if(name.equals(XACMLConstants.POLICY_SET_ELEMENT_LOCAL_NAME))
      {return PolicySet.getInstance(root, pdp.getPDPConfig().getPolicyFinder());}
    else if(name.equals(XACMLConstants.POLICY_ELEMENT_LOCAL_NAME))
      {return Policy.getInstance(root);}
    else
      {throw new ParsingException("The root element of the policy document must be '" + XACMLConstants.POLICY_SET_ID_LOCAL_NAME + "' or '" + XACMLConstants.POLICY_SET_ID_LOCAL_NAME + "', was: '" + name + "'");}
  }
View Full Code Here

    public synchronized Document readPolicy(File file)
            throws ParsingException {
        try {
            return builder.parse(file);
        } catch (IOException ioe) {
            throw new ParsingException("Failed to read the file", ioe);
        } catch (SAXException saxe) {
            throw new ParsingException("Failed to parse the file", saxe);
        }
    }
View Full Code Here

    public synchronized Document readPolicy(InputStream input)
            throws ParsingException {
        try {
            return builder.parse(input);
        } catch (IOException ioe) {
            throw new ParsingException("Failed to read the stream", ioe);
        } catch (SAXException saxe) {
            throw new ParsingException("Failed to parse the stream", saxe);
        }
    }
View Full Code Here

    public synchronized Document readPolicy(URL url)
            throws ParsingException {
        try {
            return readPolicy(url.openStream());
        } catch (IOException ioe) {
            throw new ParsingException("Failed to resolve the URL: "
                    + url.toString(), ioe);
        }
    }
View Full Code Here

            return Policy.getInstance(root);
        } else if (name.equals("PolicySet")) {
            return PolicySet.getInstance(root, policyFinder);
        } else {
            // this isn't a root type that we know how to handle
            throw new ParsingException("Unknown root document type: " + name);
        }
    }
View Full Code Here

     */
    public static HexBinaryAttribute getInstance(String value) throws ParsingException {
        byte[] bytes = hexToBin(value);

        if (bytes == null)
            throw new ParsingException("Couldn't parse purported " + "hex string: " + value);

        return new HexBinaryAttribute(bytes);
    }
View Full Code Here

            if (value.indexOf('[') == 0)
                return IPv6AddressAttribute.getV6Instance(value);
            else
                return IPv4AddressAttribute.getV4Instance(value);
        } catch (UnknownHostException uhe) {
            throw new ParsingException("Failed to parse an IPAddress", uhe);
        }
    }
View Full Code Here

            DocumentBuilder db = factory.newDocumentBuilder();
            Document doc = db.parse(new ByteArrayInputStream(bytes));

            return doc.getDocumentElement();
        } catch (Exception e) {
            throw new ParsingException("invalid XML for status detail");
        }
    }
View Full Code Here

     *             if the root node is invalid
     */
    public static StatusDetail getInstance(Node root) throws ParsingException {
        // check that it's really a StatusDetailType root
        if (!root.getNodeName().equals("StatusDetail"))
            throw new ParsingException("not a StatusDetail node");

        return new StatusDetail(root);
    }
View Full Code Here

TOP

Related Classes of com.sun.xacml.ParsingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.