Refine search
public static List validate( InputSource xml, URL schemaURL, boolean skipTargetNamespaceException, EntityResolver entityResolver) { StreamSource source = null; if (xml.getCharacterStream() != null) { source = new StreamSource(xml.getCharacterStream()); } else if (xml.getByteStream() != null) { source = new StreamSource(xml.getByteStream()); } else { throw new IllegalArgumentException("Could not turn input source to stream source"); } return validate(source, schemaURL, skipTargetNamespaceException, entityResolver); }
Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding();
public void parse(InputSource source) throws SAXException, IOException systemId = source.getSystemId(); contentHandler.setDocumentLocator(this); final Reader reader = source.getCharacterStream(); try { if (reader == null) { InputStream stream = source.getByteStream(); final String encoding = source.getEncoding(); systemId = source.getSystemId(); if(systemId == null) { SAXParseException saxException = new SAXParseException(
protected boolean canResolveEntity(String publicId, String systemId) throws SAXException, IOException { final InputSource resolvedEntity = muleEntityResolver.resolveEntity(publicId, systemId); try { return resolvedEntity != null; } finally { if (resolvedEntity != null) { if (resolvedEntity.getByteStream() != null) { resolvedEntity.getByteStream().close(); } if (resolvedEntity.getCharacterStream() != null) { resolvedEntity.getCharacterStream().close(); } } } }
} catch (MalformedURLException e) { if (is.getSystemId() == null && is.getCharacterStream() == null && is.getByteStream() == null) { throw new MalformedURLException( "The SAX InputSource has systemId == null && characterStream == null && byteStream == null. "
/** * Close the input source stream/reader if they had been created in this class * * @param source */ private void disposeInputSource() { if (!disposeInputSource) { return; } try { if (source.getByteStream() != null) { source.getByteStream().close(); } if (source.getCharacterStream() != null) { source.getCharacterStream().close(); } } catch (Exception e) { LOGGER.log(Level.FINE, "Trouble releasing input source streams", e); } }
Reader reader = input.getCharacterStream(); if (reader != null) { try { parse(reader, input.getPublicId(), input.getSystemId()); } finally { IoUtils.closeQuietly(reader); InputStream in = input.getByteStream(); String encoding = input.getEncoding(); if (in != null) { try { parse(in, encoding, input.getPublicId(), input.getSystemId()); } finally { IoUtils.closeQuietly(in); String systemId = input.getSystemId(); if (systemId == null) { throw new SAXException("No input specified.");
if (isrc != null) { InputStream in = isrc.getByteStream(); if (in != null) { return in; Reader r = isrc.getCharacterStream(); if (r != null) { return r;
Reader reader = inputSource.getCharacterStream(); if (reader != null) { try { InputStream in = inputSource.getByteStream(); if (in != null) { try { String systemId = inputSource.getSystemId(); if (systemId == null) {
when(inputSource1.getByteStream()).thenReturn(byteStream); closeableMocks.add(inputSource1); when(inputSource2.getCharacterStream()).thenReturn(reader); closeableMocks.add(inputSource2);
DocumentType doctype = null; String inputEncoding = source.getEncoding(); String systemId = source.getSystemId(); DocumentImpl document = new DocumentImpl( dom, namespaceURI, qualifiedName, doctype, inputEncoding); parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, namespaceAware); if (source.getByteStream() != null) { parser.setInput(source.getByteStream(), inputEncoding); } else if (source.getCharacterStream() != null) { parser.setInput(source.getCharacterStream()); } else if (systemId != null) { URL url = new URL(systemId);
private void closeInputSourceStream(InputSource payload) throws IOException { if (payload.getByteStream() != null) { payload.getByteStream().close(); } else if (payload.getCharacterStream() != null) { payload.getCharacterStream().close(); } }
String sysIdStr = input.getSystemId(); ReaderConfig cfg = mConfig; URL srcUrl = null; Reader r = input.getCharacterStream(); if (r == null) { is = input.getByteStream(); if (is == null) { if (sysIdStr == null) {
private void closeInputSourceStream(InputSource payload) throws IOException { if (payload.getByteStream() != null) { payload.getByteStream().close(); } else if (payload.getCharacterStream() != null) { payload.getCharacterStream().close(); } }
Reader reader = source.getCharacterStream(); if (reader != null) InputStream bytes = source.getByteStream(); if (bytes != null) String urlToLoad = source.getSystemId(); if (urlToLoad == null) throw new IOException("EntityResolver unable to resolve " + absoluteURL + " (for namespace " + namespace + ")");
private void closeInputSource(InputSource is) { if (is != null) { IOUtils.closeQuietly(is.getByteStream()); IOUtils.closeQuietly(is.getCharacterStream()); } }
private BufferedReader getBufferedReaderForInputSource(InputSource inputSource) { if (inputSource.getByteStream() != null) { return new BufferedReader(new InputStreamReader(inputSource.getByteStream())); } else if (inputSource.getCharacterStream() != null) { return new BufferedReader(inputSource.getCharacterStream()); } else if (inputSource.getSystemId() != null) { InputStream is = getInputStreamFromString(inputSource.getSystemId()); return new BufferedReader(new InputStreamReader(is)); } throw XMLMarshalException.unmarshalException(); }
public void close() throws IOException { InputStream byteStream = inputSource.getByteStream(); if (byteStream != null) byteStream.close(); else { Reader charStream = inputSource.getCharacterStream(); if (charStream != null) charStream.close(); } document = null; }
private BufferedReader getBufferedReaderForInputSource(InputSource inputSource){ if(inputSource.getByteStream() != null){ return new BufferedReader(new InputStreamReader(inputSource.getByteStream())); }else if(inputSource.getCharacterStream() != null){ return new BufferedReader(inputSource.getCharacterStream()); }else if (inputSource.getSystemId() != null){ InputStream is = getInputStreamFromString(inputSource.getSystemId()); return new BufferedReader(new InputStreamReader(is)); } throw XMLMarshalException.unmarshalException(); }
public void close() throws IOException { InputStream byteStream = inputSource.getByteStream(); if (byteStream != null) byteStream.close(); else { Reader charStream = inputSource.getCharacterStream(); if (charStream != null) charStream.close(); } document = null; }