Parses an AccessControlListHandler response XML document from an input
stream.

@param inputStream
XML data input stream.
@return the XML handler object populated with data parsed from the XML
stream.

@throws SdkClientException
961738
public AccessControlListHandler parseAccessControlListResponse(InputStream inputStream)
            throws IOException {
        AccessControlListHandler handler = new AccessControlListHandler();
        parseXmlInputStream(handler, inputStream);
        return handler;
    }
593012
public static void setHandler(XMLReader reader, Object handler) throws SAXNotSupportedException, SAXNotRecognizedException{
        if(handler instanceof ContentHandler)
            reader.setContentHandler((ContentHandler)handler);
        if(handler instanceof EntityResolver)
            reader.setEntityResolver((EntityResolver)handler);
        if(handler instanceof ErrorHandler)
            reader.setErrorHandler((ErrorHandler)handler);
        if(handler instanceof DTDHandler)
            reader.setDTDHandler((DTDHandler)handler);
        if(handler instanceof LexicalHandler){
            try{
                reader.setProperty(SAXProperties.LEXICAL_HANDLER, handler);
            }catch(SAXException ex){
                reader.setProperty(SAXProperties.LEXICAL_HANDLER_ALT, handler);
            }
        }
        if(handler instanceof DeclHandler){
            try{
                reader.setProperty(SAXProperties.DECL_HANDLER, handler);
            }catch(SAXException ex){
                reader.setProperty(SAXProperties.DECL_HANDLER_ALT, handler);
            }
        }
    }
297983
@Override
	public Resource parse(InputStream input) throws IOException, FHIRFormatError {
		try {
			XmlPullParser xpp = loadXml(input);
			return parse(xpp);
		} catch (XmlPullParserException e) {
			throw new FHIRFormatError(e.getMessage(), e);
		}
	}
476682
public void parseStream (InputStream stream)
        throws IOException
    {
        try {
            // read the XML input stream and construct the scene object
            _chars = new StringBuilder();
            XMLUtil.parse(this, stream);

        } catch (ParserConfigurationException pce) {
            throw (IOException) new IOException().initCause(pce);

        } catch (SAXException saxe) {
            throw (IOException) new IOException().initCause(saxe);
        }
    }
1034107
@PostMapping(path = SamlProtocolConstants.ENDPOINT_SAML_VALIDATE)
    @Override
    public ModelAndView handleRequestInternal(final HttpServletRequest request,
                                              final HttpServletResponse response) throws Exception {
        return super.handleRequestInternal(request, response);
    }
500788
public static Document getSOAPMessage(InputStream in) throws Exception {
        /*
         * ByteArrayOutputStream out = new ByteArrayOutputStream(); int b; while
         * ((b = in.read()) != -1) { out.write(b); }
         * 
         * System.out.println("OUT:" + out.toString());
         */
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
	   // Fortify Mod: Disable entity expansion to foil External Entity Injections
	   dbf.setExpandEntityReferences(false);
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document soapMessage = db.newDocument();
          // Fortify Mod: prevent external entity injection
        TransformerFactory tf = TransformerFactory.newInstance();
        tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
        Transformer t = tf.newTransformer();
	   // End Fortify Mod
        t.transform(new StreamSource(in), new DOMResult(soapMessage));
        return soapMessage;
    }
461492
public XcapResponseImpl handleResponse(HttpResponse httpResponse)
			throws ClientProtocolException, IOException {

		int statusCode = httpResponse.getStatusLine().getStatusCode();

		String eTag = null;
		String mimetype = null;
		if (statusCode == 200 || statusCode == 201) {
			// sucessful response
			org.apache.http.Header eTagHeader = httpResponse
					.getFirstHeader(XcapConstant.HEADER_ETAG);
			if (eTagHeader != null) {
				eTag = eTagHeader.getValue();
			}
			org.apache.http.Header mimetypeHeader = httpResponse
			.getFirstHeader(XcapConstant.HEADER_CONTENT_TYPE);
			if (mimetypeHeader != null) {
				mimetype = mimetypeHeader.getValue();
			}
		}

		final org.apache.http.Header[] apacheHeaders = httpResponse
				.getAllHeaders();
		final Header[] headers = new Header[apacheHeaders.length];
		for (int i = 0; i < headers.length; i++) {
			headers[i] = new HeaderImpl(apacheHeaders[i]);
		}

		final HttpEntity httpEntity = httpResponse.getEntity();

		final XcapEntityImpl xcapEntity = httpEntity != null ? new XcapEntityImpl(
				httpEntity)
				: null;

		return new XcapResponseImpl(statusCode, eTag, mimetype, headers, xcapEntity);
	}
34162
public static Layout parseStream(InputStream stream) {
        try (InputStream is = stream) {
            return parseDocument(XMLUtil.parseXMLFromStream(is));
        } catch (Exception e) {
            throw MiscUtil.toUnchecked(e);
        }
    }
335631
public void parse(InputStream xmlInput) throws XMLStreamException {
    InputStream input = isoControlCharsAwareParser ? new ISOControlCharAwareInputStream(xmlInput) : xmlInput;
    parse(inf.rootElementCursor(input));
  }
6054
public static Response loadFromXML(Sso ssoService, String xml) throws CertificateException, ParserConfigurationException, SAXException, IOException {
		return new Response(ssoService.getSamlSettings().getIdpCertificate(), xml);
	}
641819
public SOAPEnvelope parse(InputStream input) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        factory.setValidating(false);
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse(input);
        SOAPElement soapElement = SOAPFactory.newInstance().createElement(doc.getDocumentElement());
        SOAPEnvelope envelope = (SOAPEnvelope) soapElement;
        return envelope;
    }
1198981
protected AccessTokenRequestDataHolder extractInternal(final HttpServletRequest request, final HttpServletResponse response,
                                                           final AccessTokenRequestDataHolder.AccessTokenRequestDataHolderBuilder builder) {
        return builder.build();
    }
1249622
protected void parseXml(Reader reader, XmlNamespaceDictionary namespaceDictionary)
    throws IOException, XmlPullParserException {
    this.xmlPullParser.setInput(reader);
    Xml.parseElement(this.xmlPullParser, this, namespaceDictionary, null);
  }
1049438
public static WMSEndpoint parse(InputStream inputStream) throws Exception {
        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();

        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
        dBuilder.setEntityResolver(new EntityResolver() {
            @Override
            public InputSource resolveEntity(String publicId, String systemId)
                throws SAXException, IOException {
                return new InputSource(new StringReader(""));

            }
        });
        Document doc = dBuilder.parse(inputStream);


        Element element=doc.getDocumentElement();
        element.normalize();

        if (element.getNodeName().contains("WMT_MS_Capabilities")) {
            return DomParserWms111.parse(element);
        } else if (element.getNodeName().contains("WMS_Capabilities")) {
            return DomParserWms111.parse(element);
        }
        throw new IllegalArgumentException("Unknown root element: " + element.getNodeName());


    }
840434
public static ContentMatcher getInstance(InputStream xmlInputStream) {
        ContentMatcher cm = new ContentMatcher();

        // Load the pattern definitions from an XML file
        try {
            cm.loadXMLPatternDefinitions(xmlInputStream);
            
        } catch (JDOMException | IOException ex) {
            throw new IllegalArgumentException("Failed to initialize the ContentMatcher object using that stream", ex);
        }
        
        return cm;
    }
1152436
public FASPConnectionInfoHandler parseFASPConnectionInfoResponse(InputStream inputStream)
            throws IOException {
        FASPConnectionInfoHandler handler = new FASPConnectionInfoHandler();
        parseXmlInputStream(handler, inputStream);
        return handler;
    }
60999
public BucketLoggingConfigurationHandler parseLoggingStatusResponse(InputStream inputStream)
            throws IOException {
        BucketLoggingConfigurationHandler handler = new BucketLoggingConfigurationHandler();
        parseXmlInputStream(handler, inputStream);
        return handler;
    }