Package org.apache.xindice.util

Examples of org.apache.xindice.util.XindiceException


    }

    public void insertDocument(String path, String name, String doc) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }

        XMLResource document = (XMLResource) col.createResource(name, "XMLResource");
        document.setContent(doc);
        col.storeResource(document);
View Full Code Here


    }

    public int countDocument(String path) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }

        return col.getResourceCount();
    }
View Full Code Here

    }

    public String getDocument(String path, String name) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);

        if (document == null) {
            return null;
View Full Code Here

    }

    public void updateDocument(String path, String name, String doc) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);
        document.setContent(doc);
        col.storeResource(document);
    }
View Full Code Here

    }

    public void getDocumentAsSax(String path, String name, ContentHandler handler) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);

        if (document == null) {
            return;
View Full Code Here

    }

    public void removeDocument(String path, String name) throws Exception {
        Collection col = DatabaseManager.getCollection(driver + "/" + path);
        if (col == null) {
            throw new XindiceException("DatabaseManager.getCollection(" + driver + "/" + path + ") returned null");
        }
        XMLResource document = (XMLResource) col.getResource(name);

        col.removeResource(document);
    }
View Full Code Here

    public DOMParser() throws XindiceException {
        try {
            sp = getSAXParser();
        } catch (Exception e) {
            throw new XindiceException("Error creating parser", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(input);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(xml);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(value);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.xindice.util.XindiceException

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.