Package org.expath.pkg.repo.FileSystemStorage

Examples of org.expath.pkg.repo.FileSystemStorage.FileSystemResolver


            throw new XPathException("Invalid URI: " + namespace, ex);
        }
        for (final Packages pp : myParent.listPackages()) {
            final Package pkg = pp.latest();
            // FIXME: Rely on having a file system storage, that's probably a bad design!
            final FileSystemResolver resolver = (FileSystemResolver) pkg.getResolver();
            final ExistPkgInfo info = (ExistPkgInfo) pkg.getInfo("exist");
            if (info != null) {
                final String f = info.getXQuery(uri);
                if (f != null) {
                    return resolver.resolveComponentAsFile(f);
                }
            }
            String sysid = null; // declared here to be used in catch
            try {
                final StreamSource src = pkg.resolve(namespace, URISpace.XQUERY);
View Full Code Here


    private void setupPackage(Package pkg, ExistPkgInfo info)
            throws PackageException
    {
        // TODO: FIXME: Bad, BAD design!  But will be resolved naturally by moving the
        // install code within the storage class (because we are writing on disk)...
        final FileSystemResolver res = (FileSystemResolver) pkg.getResolver();
        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);
                }
View Full Code Here

TOP

Related Classes of org.expath.pkg.repo.FileSystemStorage.FileSystemResolver

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.