Package org.openjena.atlas

Examples of org.openjena.atlas.AtlasException


    @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<E>(deserializer, in) ;
            registerCloseableIterator(irc);
            toReturn = irc;
View Full Code Here

        write(ch) ;
        column += 1 ;
    }

    private void write(char ch)
    { try { out.write(ch) ; } catch (IOException ex) { throw new AtlasException(ex) ; } }
View Full Code Here

    private void write(char ch)
    { try { out.write(ch) ; } catch (IOException ex) { throw new AtlasException(ex) ; } }
   
    private void write(String s)
    { try { out.write(s) ; } catch (IOException ex) { throw new AtlasException(ex) ; } }
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

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

        bb.flip() ;
        out.send(bb) ;
    }
   
    private static void exception(IOException ex)
    { throw new AtlasException(ex) ; }
View Full Code Here

        else
            IO.exception(new IOException("Illegal UTF-8: "+x)) ;

        // This test will go off.  We're processing a 4 byte sequence but Java only supports 16 bit chars.
        if ( ch > Character.MAX_VALUE )
            throw new AtlasException("Out of range character (must use a surrogate pair)") ;
        if ( ! Character.isDefined(ch) ) throw new AtlasException(String.format("Undefined codepoint: 0x%04X", ch)) ;
        return ch ;
    }
View Full Code Here

        int x = start ;
        for ( int i = 0 ; i < len-1 ; i++ )
        {
            int x2 = input.advance() ;
            if ( x2 == -1 )
                throw new AtlasException("Premature end to UTF-8 sequence at end of input") ;
           
            if ( (x2 & 0xC0) != 0x80 )
                //throw new AtlasException("Illegal UTF-8 processing character "+count+": "+x2) ;
                throw new AtlasException(String.format("Illegal UTF-8 processing character: 0x%04X",x2)) ;
            // 6 bits of x2
            x = (x << 6) | (x2 & 0x3F);
        }
        return x ;
    }
View Full Code Here

TOP

Related Classes of org.openjena.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.