Package org.apache.jena.atlas.web

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


   
    private static void open(StreamManager streamMgr, String dataName, Context context)
    {
        StreamManager.setGlobal(streamMgr) ;
        try {
            TypedInputStream in = ( context != null )
                ? RDFDataMgr.open(dataName, context)
                : RDFDataMgr.open(dataName) ;
            assertNotNull(in) ;
            IO.close(in) ;
        } finally {
View Full Code Here


    }
   
    @Test public void locatorFile_05()
    {
        LocatorFile loc = new LocatorFile() ;
        TypedInputStream ts = loc.open(testingDir+"data.ttl") ;
        assertTrue("Not equal: "+WebContent.contentTypeTurtle+" != "+ts.getMediaType(),
                   WebContent.contentTypeTurtle.equalsIgnoreCase(ts.getContentType())) ;
    }
View Full Code Here

    @Test public void read_24()   { jenaread("D-json", "RDF/JSON") ; }
   
    @Test public void read_30()
    {
        {
            TypedInputStream in = RDFDataMgr.open(filename("D-not-TTL.ttl") );
            Model m0 = ModelFactory.createDefaultModel() ;
            RDFDataMgr.read(m0, in, RDFLanguages.RDFXML) ;
        }

        TypedInputStream in1 = RDFDataMgr.open(filename("D-not-TTL.ttl") );
        Model m1 = ModelFactory.createDefaultModel() ;
        // Fails until integration with jena-core as hintlang gets lost.
        m1.read(in1, null, "RDF/XML") ;
    }
View Full Code Here

    /**
     * Open a file using the locators of this FileManager but without location
     * mapping. Throws RiotNotFoundException if not found.
     */
    public TypedInputStream openNoMap(String filenameOrURI) {
        TypedInputStream in = openNoMapOrNull(filenameOrURI) ;
        if ( in == null )
            throw new RiotNotFoundException(filenameOrURI) ;
        return in ;
    }
View Full Code Here

     * mapping. Return null if not found
     */

    public TypedInputStream openNoMapOrNull(String filenameOrURI) {
        for (Locator loc : handlers) {
            TypedInputStream in = loc.open(filenameOrURI) ;
            if ( in != null ) {
                if ( log.isDebugEnabled() )
                    log.debug("Found: " + filenameOrURI + " (" + loc.getName() + ")") ;
                return in ;
            }
View Full Code Here

        smgr.addLocator(new LocatorFile()) ;
        smgr.addLocator(new LocatorClassLoader(smgr.getClass().getClassLoader())) ;

        try {
            String uriConfig = null ;
            TypedInputStream in = null ;

            StringTokenizer pathElems = new StringTokenizer(configPath, AdapterFileManager.PATH_DELIMITER) ;
            while (pathElems.hasMoreTokens()) {
                String uri = pathElems.nextToken() ;
                if ( uri == null || uri.length() == 0 )
View Full Code Here

            if ( StreamManager.logAllLookups && log.isTraceEnabled() )
                log.trace("Found: "+filenameIRI+thisDirLogStr) ;
           
            ContentType ct = RDFLanguages.guessContentType(filenameIRI) ;
            return new TypedInputStream(in, ct, filenameIRI) ;
        } catch (IOException ioEx)
        {
            // Includes FileNotFoundException
            // We already tested whether the file exists or not.
            log.warn("File unreadable (but exists): "+fn+" Exception: "+ioEx.getMessage()) ;
View Full Code Here

        if ( StreamManager.logAllLookups  && log.isTraceEnabled() )
            log.trace("Found: "+resourceName) ;
       
        ContentType ct = RDFLanguages.guessContentType(resourceName) ;
        // No sensible base URI.
        return new TypedInputStream(in, ct, null) ;
    }
View Full Code Here

    {
        // We need to do this ourselves, not via riot, to use the webStreamManager
        StreamRDF sink = StreamRDFLib.graph(graph) ;
        sink = new SinkRDFLimited(sink, limit) ;

        TypedInputStream input = Fuseki.webStreamManager.open(uri) ;
        RDFDataMgr.parse(sink, input, uri) ;
    }
View Full Code Here

    static String simpleQuery = queryURL+"?query="+IRILib.encodeUriComponent("ASK{}") ;
   
    // Basic operations
   
    @Test public void httpGet_01() {
        TypedInputStream in = HttpOp.execHttpGet(pingURL) ;
        IO.close(in) ;
    }
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.