Java 8 InputSource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InputSource class.

This code example shows how to use the following methods:
        if (inputStream == null) {
            throw new RuntimeException(xmlResource + " could not be found");
        } 
        DOMParser domParser = new DOMParser();
        try { 
            domParser.parse(new InputSource(inputStream));
            return SUCCESS_MESSAGE;
        } catch (Exception e) {
            throw new RuntimeException(e);
        } 
    } 
 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getCharacterStream, setCharacterStream, setPublicId, setSystemId
                MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException {
 
            try { 
                if (source instanceof StreamSource) {
                    StreamSource stream = (StreamSource) source;
                    InputSource inputStream = new InputSource(stream.getInputStream());
                    inputStream.setCharacterStream(inputStream.getCharacterStream());
                    inputStream.setPublicId(stream.getPublicId());
                    inputStream.setSystemId(source.getSystemId());
                    source = new SAXSource(saxParserFactory.provide().newSAXParser().getXMLReader(), inputStream);
                } 
 
                StreamResult sr = new StreamResult(entityStream);
                transformerFactory.provide().newTransformer().transform(source, sr);
 
            } catch (SAXException ex) {
                throw new InternalServerErrorException(ex);
            } catch (ParserConfigurationException ex) {
                throw new InternalServerErrorException(ex);
            } catch (TransformerException ex) {
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
        } 
 
        URL hyphenationPatternsFile = env.resolveConfig(hyphenationPatternsPath);
 
        try { 
            hyphenationTree = HyphenationCompoundWordTokenFilter.getHyphenationTree(new InputSource(hyphenationPatternsFile.toExternalForm()));
        } catch (Exception e) {
            throw new ElasticSearchIllegalArgumentException("Exception while reading hyphenation_patterns_path: " + e.getMessage());
        } 
    } 
 
    @Override 
    public TokenStream create(TokenStream tokenStream) {
        return new HyphenationCompoundWordTokenFilter(version, tokenStream,
                hyphenationTree, wordList,
                minWordSize, minSubwordSize, maxSubwordSize, onlyLongestMatch); 
    } 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
import org.xml.sax.SAXException; 
 
public class NoOpEntityResolver implements EntityResolver { 
 
    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { 
        return new InputSource(new StringReader("")); 
    } 
 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
        } 
    } 
 
    private void parse(final InputStream inputStream) throws IOException, SAXException {
        DOMParser domParser = new DOMParser();
        domParser.parse(new InputSource(inputStream));
    } 
 
 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 InputSource Questions & Answers:

Other Java 8 InputSource Examples

5:				DocumentBuilder db = dbf.newDocumentBuilder();
6:	
7:				InputSource is = new InputSource();
8:			        is.setCharacterStream(new StringReader(xml));
9:			        doc = db.parse(is); 
-
5:				DocumentBuilder db = dbf.newDocumentBuilder();
6:	
7:				InputSource is = new InputSource();
8:			        is.setCharacterStream(new StringReader(xml));
9:			        doc = db.parse(is);

Read More

68:	
69:				InputSource is = new InputSource();
70:			        is.setCharacterStream(new StringReader(xml));
71:			        doc = db.parse(is); 
72:	
-
68:	
69:				InputSource is = new InputSource();
70:			        is.setCharacterStream(new StringReader(xml));
71:			        doc = db.parse(is); 
72:

Read More

68:	
69:				InputSource is = new InputSource();
70:			        is.setCharacterStream(new StringReader(xml));
71:			        doc = db.parse(is); 
72:	
-
68:	
69:				InputSource is = new InputSource();
70:			        is.setCharacterStream(new StringReader(xml));
71:			        doc = db.parse(is); 
72:

Read More

See Code Examples for Java 8 InputSource Methods: