Package org.expath.pkg.repo

Examples of org.expath.pkg.repo.PackageException


                    handleElement(parser, pkg, info);
                }
                else {
                    // ignore elements not in the eXist Pkg namespace
                    // TODO: FIXME: Actually ignore (pass it.)
                    throw new PackageException("TODO: Ignore elements in other namespace");
                }
                parser.next();
            }
            // position to </package>
            parser.next();
        }
        catch ( final XMLStreamException ex ) {
            throw new PackageException("Error reading the exist descriptor", ex);
        }
        pkg.addInfo(getName(), info);
        // if the package has never been installed, install it now
        // TODO: This is not an ideal solution, but this should work in most of
        // the cases, and does not need xrepo to depend on any processor-specific
View Full Code Here


        }
        else if ( "xquery".equals(local) ) {
            handleXQuery(parser, pkg, info);
        }
        else {
            throw new PackageException("Unknown eXist component type: " + local);
        }
    }
View Full Code Here

        parser.next();
        try {
            info.addJava(new URI(href), clazz);
        }
        catch ( final URISyntaxException ex ) {
            throw new PackageException("Invalid URI: " + href, ex);
        }
    }
View Full Code Here

        parser.next();
        try {
            info.addXQuery(new URI(href), file);
        }
        catch ( final URISyntaxException ex ) {
            throw new PackageException("Invalid URI: " + href, ex);
        }
    }
View Full Code Here

        final File classpath = res.resolveResourceAsFile(".exist/classpath.txt");

        // create [pkg_dir]/.exist/classpath.txt if not already
        final File exist = classpath.getParentFile();
        if ( ! exist.exists() && ! exist.mkdir() ) {
            throw new PackageException("Impossible to create directory: " + exist);
        }
        final Set<String> jars = info.getJars();
        try {
            final FileWriter out = new FileWriter(classpath);
            for ( final String jar : jars ) {
                StreamSource jar_src;
                try {
                    jar_src = res.resolveComponent(jar);
                }
                catch ( final NotExistException ex ) {
                    final String msg = "Inconsistent package descriptor, the JAR file is not in the package: ";
                    throw new PackageException(msg + jar, ex);
                }
                final URI uri = URI.create(jar_src.getSystemId());
                final File file = new File(uri);
                out.write(file.getCanonicalPath());
                out.write("\n");
            }
            out.close();
        }
        catch ( final IOException ex ) {
            throw new PackageException("Error writing the eXist classpath file: " + classpath, ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.expath.pkg.repo.PackageException

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.