Package org.openbel.framework.core.indexer

Examples of org.openbel.framework.core.indexer.IndexingFailure


        try {
            equivalenceHeader = equivalenceParser.parseEquivalence(
                    resourceLocation, rawEquivalence);
            characterStopOffset = equivalenceParser.getNextCharacterOffset();
        } catch (IOException e) {
            throw new IndexingFailure(name, e);
        } catch (BELDataMissingPropertyException e) {
            throw new IndexingFailure(name, e);
        } catch (BELDataConversionException e) {
            throw new IndexingFailure(name, e);
        }

        final EquivalenceBlock eqblock =
                equivalenceHeader.getEquivalenceBlock();
        final String eqhome = equivalenceHomeFile.getAbsolutePath();
        String eqname = eqblock.getNameString().replace(' ', '-');
        String eqversion = eqblock.getVersionString().replace(' ', '-');
        String path = asPath(eqhome, eqname, eqversion);

        createDirectories(path);
        final String outputPath = asPath(path, "equivalence.header");

        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(new FileOutputStream(outputPath));
            oos.writeObject(equivalenceHeader);
            return new File(outputPath);
        } catch (IOException e) {
            final String msg = "Error writing equivalencer header.";
            throw new IndexingFailure(resourceLocation, msg, e);
        } finally {
            if (oos != null) {
                try {
                    oos.close();
                } catch (IOException e) {}
View Full Code Here


        try {
            annotationHeader = ahParser.parseAnnotation(resourceLocation,
                    rawannotation);
            characterStopOffset = ahParser.getNextCharacterOffset();
        } catch (IOException e) {
            throw new IndexingFailure(resourceLocation, e);
        } catch (BELDataMissingPropertyException e) {
            throw new IndexingFailure(resourceLocation, e);
        } catch (BELDataConversionException e) {
            throw new IndexingFailure(resourceLocation, e);
        } catch (BELDataInvalidPropertyException e) {
            throw new IndexingFailure(resourceLocation, e);
        }

        String output = asPath(annotationHomeFile.getAbsolutePath(),
                "annotation.header");

        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(
                    new FileOutputStream(output));
            oos.writeObject(annotationHeader);
        } catch (IOException e) {
            final String msg = "Error writing annotation header.";
            throw new IndexingFailure(resourceLocation, msg, e);
        } finally {
            if (oos != null) {
                try {
                    oos.close();
                } catch (IOException e) {}
View Full Code Here

            namespaceHeader = nshParser.parseNamespace(resourceLocation,
                    rawNamespace);
            characterStopOffset = nshParser.getNextCharacterOffset();
        } catch (IOException e) {
            final String name = rawNamespace.getAbsolutePath();
            throw new IndexingFailure(name, e);
        } catch (BELDataMissingPropertyException e) {
            final String name = rawNamespace.getAbsolutePath();
            throw new IndexingFailure(name, e);
        } catch (BELDataConversionException e) {
            final String name = rawNamespace.getAbsolutePath();
            throw new IndexingFailure(name, e);
        }

        String output = asPath(namespaceHomeFile.getAbsolutePath(),
                "namespace.header");
        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(
                    new FileOutputStream(output));
            oos.writeObject(namespaceHeader);
            return new File(output);
        } catch (IOException e) {
            final String msg = "Error writing namespace header.";
            throw new IndexingFailure(resourceLocation, msg, e);
        } finally {
            if (oos != null) {
                try {
                    oos.close();
                } catch (IOException e) {}
View Full Code Here

        // get opened namespace and lookup namespace parameter encoding
        JDBMNamespaceLookup il = openNamespaces.get(ns.getResourceLocation());
        if (il == null) {
            final String fmt = "Namespace '%s' is not open.";
            final String msg = String.format(fmt, resourceLocation);
            throw new IndexingFailure(resourceLocation, msg);
        }

        String encoding = il.lookup(p.getValue());

        if (encoding == null) {
View Full Code Here

            try {
                il.open();
            } catch (IOException e) {
                final String fmt = "Failed to open namespace '%s'.";
                final String msg = String.format(fmt, resourceLocation);
                throw new IndexingFailure(resourceLocation, msg, e);
            }

            openNamespaces.put(resourceLocation, il);
        }
    }
View Full Code Here

                    jdbmlookup.close();
                    openNamespaces.remove(resourceLocation);
                } catch (IOException e) {
                    final String fmt = "Failed to close namespace '%s'.";
                    final String msg = String.format(fmt, resourceLocation);
                    throw new IndexingFailure(resourceLocation, msg, e);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.openbel.framework.core.indexer.IndexingFailure

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.