@Override protected void receiveContent(InputStream content) { try { if (logger.isInfoEnabled()) logger.info("Parsing metadata structure from input stream"); Document document = null; if (content != null) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(false); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(new InputSource(new InputStreamReader(content, "UTF-8"))); content.close(); } receiveMetadataImpl(document); } catch (SAXException e) { logger.error("Failed to parse metadata structure from input stream",e); throw new MarkLogicInternalException(e); } catch (IOException e) { logger.error("Failed to parse metadata structure from input stream",e); throw new MarkLogicInternalException(e); } catch (ParserConfigurationException e) { logger.error("Failed to parse metadata structure from input stream",e); throw new MarkLogicInternalException(e); } } @Override
@Override protected void receiveContent(InputStream content) { try { if (logger.isInfoEnabled()) logger.info("Parsing metadata structure from input stream"); Document document = null; if (content != null) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(false); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(new InputSource(new InputStreamReader(content, "UTF-8"))); content.close(); } receiveMetadataImpl(document); } catch (SAXException e) { logger.error("Failed to parse metadata structure from input stream",e); throw new MarkLogicInternalException(e); } catch (IOException e) { logger.error("Failed to parse metadata structure from input stream",e); throw new MarkLogicInternalException(e); } catch (ParserConfigurationException e) { logger.error("Failed to parse metadata structure from input stream",e); throw new MarkLogicInternalException(e); } } @Override