Package org.apache.jena.atlas

Examples of org.apache.jena.atlas.AtlasException


    public static PeekReader open(String filename) {
        try {
            InputStream in = new FileInputStream(filename) ;
            return makeUTF8(in) ;
        } catch (FileNotFoundException ex) {
            throw new AtlasException("File not found: " + filename) ;
        }
    }
View Full Code Here


        this.serializationFactory = serializerFactory;
    }
   
    private void checkClosed()
    {
        if (closed) throw new AtlasException("DefaultDataBag is closed, no operations can be performed on it.") ;
    }
View Full Code Here

    @Override
    public void add(E item)
    {
        checkClosed();
        if (finishedAdding)
            throw new AtlasException("DefaultDataBag: Cannot add any more items after the writing phase is complete.");
       
        if (!policy.isThresholdExceeded())
        {
            memory.add(item);
        }
View Full Code Here

        {
            out = getSpillStream();
        }
        catch (IOException e)
        {
            throw new AtlasException(e);
        }
        serializer = serializationFactory.createSerializer(out);
       
        for (E e : memory)
        {
View Full Code Here

            {
                in = new BufferedInputStream(new FileInputStream(spillFile)) ;
            }
            catch ( FileNotFoundException ex )
            {
                throw new AtlasException(ex) ;
            }
            Iterator<E> deserializer = serializationFactory.createDeserializer(in) ;
            IteratorResourceClosing<E> irc = new IteratorResourceClosing<>(deserializer, in) ;
            registerCloseableIterator(irc);
            toReturn = irc;
View Full Code Here

        {
            blacklist = getInputIterator(firstSpillFile);
        }
        catch ( FileNotFoundException e )
        {
            throw new AtlasException("Cannot find the first spill file", e);
        }
       
        // TODO: Improve performance by making the superclass .iterator() use getNetSpillFiles()
        // instead of getSpillFiles() so it doesn't contain the contents of the first file
        Iterator<E> rest = super.iterator();
View Full Code Here

   
    /** Convert an IRI to a filename */
    public static String IRIToFilename(String iri)
    {
        if ( ! iri.startsWith("file:") )
            throw new AtlasException("Not a file: URI: "+iri) ;
       
        String fn ;
        if ( iri.startsWith("file:///") )
            fn = iri.substring("file://".length()) ;
        else
View Full Code Here

    static public InputStream openFile(String filename)
    {
        try {
           return openFileEx(filename) ;
        }
        catch (Exception ex) { throw new AtlasException(ex) ; }
    }
View Full Code Here

        try { resource.close()} catch (Exception ex) { }
    }

    public static void exception(IOException ex)
    {
        throw new AtlasException(ex) ;
    }
View Full Code Here

        throw new AtlasException(ex) ;
    }

    public static void exception(String msg, IOException ex)
    {
        throw new AtlasException(msg, ex) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.AtlasException

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.