Package org.apache.jena.atlas.web

Examples of org.apache.jena.atlas.web.TypedInputStream


    }
   
    @Test(expected=HttpException.class)
    public void httpGet_02() {
        try {
            TypedInputStream in = HttpOp.execHttpGet(ServerTest.urlRoot+"does-not-exist") ;
            IO.close(in) ;
        } catch(HttpException ex) {
            assertEquals(HttpSC.NOT_FOUND_404, ex.getResponseCode()) ;
            throw ex ;
        }
View Full Code Here


        String x = HttpOp.execHttpGetString(ServerTest.urlRoot+"does-not-exist") ;
        assertNull(x) ;
    }
   
    @Test public void httpGet_05() {
        TypedInputStream in = HttpOp.execHttpGet(simpleQuery) ;
        IO.close(in) ;
    }
View Full Code Here

    }
   
    // SPARQL Query
   
    @Test public void queryGet_01() {
        TypedInputStream in = HttpOp.execHttpGet(simpleQuery) ;
        IO.close(in) ;
    }
View Full Code Here

    @Test(expected=HttpException.class)
    public void queryGet_02() {
        try {
            // No query.
            TypedInputStream in = HttpOp.execHttpGet(queryURL+"?query=") ;
            IO.close(in) ;
        } catch (HttpException ex) {
            assertEquals(ex.getResponseCode(), HttpSC.BAD_REQUEST_400) ;
            throw ex ;
        }
View Full Code Here

    }
       
    @Test public void httpPost_04() {
        Params params = new Params() ;
        params.addParam("query", "ASK{}") ;
        TypedInputStream in = HttpOp.execHttpPostFormStream(queryURL, params, WebContent.contentTypeResultsJSON) ;
        IO.close(in) ;
    }
View Full Code Here

   
    @Test(expected=HttpException.class)
    public void httpPost_05() {
        Params params = new Params() ;
        params.addParam("query", "ASK{}") ;
        TypedInputStream in = null ;
        try {
            // Query to Update
            in = HttpOp.execHttpPostFormStream(updateURL, params, WebContent.contentTypeResultsJSON) ;
        } catch (HttpException ex) {
            assertEquals(ex.getResponseCode(), HttpSC.BAD_REQUEST_400) ;
View Full Code Here

    public AdapterLocator(Locator locator) { this.locator = locator ; }

    @Override
    public com.hp.hpl.jena.util.TypedStream open(String filenameOrURI)
    {
        TypedInputStream in = locator.open(filenameOrURI) ;
        return AdapterLib.convert(in) ;
    }
View Full Code Here

        @Override
        public void handle(String baseIRI, HttpResponse response) throws IOException {

            HttpEntity entity = response.getEntity();
            String ct = (entity.getContentType() == null) ? null : entity.getContentType().getValue();
            stream = new TypedInputStream(entity.getContent(), ct);
        }
View Full Code Here

     * @param lang      Language syntax
     */
    public static void read(Graph graph, InputStream in, String base, Lang lang)
    {
        StreamRDF dest = StreamRDFLib.graph(graph) ;
        process(dest, new TypedInputStream(in), base, lang, null) ;
    }
View Full Code Here

     * @param lang      Language syntax
     */
    public static void read(DatasetGraph dataset, InputStream in, String base, Lang lang)
    {
        StreamRDF dest = StreamRDFLib.dataset(dataset) ;
        process(dest, new TypedInputStream(in), base, lang, null) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.web.TypedInputStream

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.