Package org.apache.xml.resolver

Examples of org.apache.xml.resolver.Catalog


    }

    ResolvingParser.validating = validating;
    ResolvingParser.namespaceAware = nsAware;
    ResolvingParser reader = new ResolvingParser();
    Catalog catalog = reader.getCatalog();

    for (int count = 0; count < catalogFiles.size(); count++) {
      String file = (String) catalogFiles.elementAt(count);
      catalog.parseCatalog(file);
    }

    XParseError xpe = new XParseError(showErrors, showWarnings);
    xpe.setMaxMessages(maxErrs);
    reader.setErrorHandler(xpe);
View Full Code Here


      reader.setFeature("http://xml.org/sax/features/validation", validating);
    } catch (SAXException e) {
      // nop;
    }

    Catalog catalog = reader.getCatalog();

    for (int count = 0; count < catalogFiles.size(); count++) {
      String file = (String) catalogFiles.elementAt(count);
      catalog.parseCatalog(file);
    }

    XParseError xpe = new XParseError(showErrors, showWarnings);
    xpe.setMaxMessages(maxErrs);
    reader.setErrorHandler(xpe);
View Full Code Here

        }

        OASISCatalogManager catalogManager = new OASISCatalogManager();
        URL catalogURL = JAXWSUtils.getOASISCatalogURL(bundle, this.catalogName);
        if (catalogURL != null) {
            Catalog catalog = catalogManager.getCatalog();
            catalog.parseCatalog(catalogURL);
            //The default logic in the Catalog.parseCatalogFile(String) method always assume that the URL is file-based
            //This is not correct in OSGi environment, so considering that one Catalog instance will be shared per OASISCatalogManager
            //instance, we will call the parseCatalog(URL) to add the file
            //catalogManager.setCatalogFiles(catalogURL.toString());
        }
View Full Code Here

        URL catalogURL = getCatalog();
        if (catalogURL != null) {
            composite = new DescriptionBuilderComposite();
            OASISCatalogManager catalogManager = new OASISCatalogManager();
            Catalog catalog = catalogManager.getCatalog();
            try {
                catalog.parseCatalog(catalogURL);
            } catch (IOException e) {
                NamingException toThrow = new NamingException("Fail to parse catalog file " + catalogURL.toString());
                toThrow.initCause(e);
                throw toThrow;
            }           
View Full Code Here

        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here

      
    }
   
    private String resolveWSDLLocationByCatalog(String wsdlLocation) {
        if (catalogManager != null) {
            Catalog catalog = catalogManager.getCatalog();
            if (catalog != null) {
                String resolvedLocation = null;
                try {
                    resolvedLocation = catalog.resolveSystem(wsdlLocation);
                    if (resolvedLocation == null) {
                        resolvedLocation = catalog.resolveURI(wsdlLocation);
                    }
                    // normally, one might also do the following, but in this case we're looking at a top-level WSDL, so no parent
                    // resolvedLocation = catalog.resolvePublic(wsdlLocation, parent);
                    if (resolvedLocation != null) {
                        if (log.isDebugEnabled()) {
View Full Code Here

    public static Catalog getCatalog(Bus bus) {
        if (bus == null) {
            return getContextCatalog();
        }
        Catalog catalog = bus.getExtension(Catalog.class);
        if (catalog == null) {
            return getContextCatalog();
        } else {
            return catalog;
        }
View Full Code Here

    }

    private Document getWSDLDoc(String wsdl) {
        LOG.log(Level.FINE, new Message("VALIDATE_WSDL", LOG, wsdl).toString());
        try {
            Catalog catalogResolver = OASISCatalogManager.getCatalogManager(this.getBus()).getCatalog();

            String nw = catalogResolver.resolveSystem(wsdl);
            if (nw == null) {
                nw = catalogResolver.resolveURI(wsdl);
            }
            if (nw == null) {
                nw = catalogResolver.resolvePublic(wsdl, null);
            }
            if (nw == null) {
                nw = wsdl;
            }
            return XMLUtils.parse(new InputSource(URIParserUtil.getAbsoluteURI(nw)));
View Full Code Here

     * parsed immediately. The others will be queued and read if
     * they are needed later.
     */
    private void parseCatalogs () throws IOException {
        if (fCatalogsList != null) {
            fCatalog = new Catalog(fResolverCatalogManager);
            attachReaderToCatalog(fCatalog);
            for (int i = 0; i < fCatalogsList.length; ++i) {
                String catalog = fCatalogsList[i];
                if (catalog != null && catalog.length() > 0) {
                    fCatalog.parseCatalog(catalog);
View Full Code Here

        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here

TOP

Related Classes of org.apache.xml.resolver.Catalog

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.