Java Code Examples for com.sun.org.apache.xml.internal.resolver.Catalog#parseCatalog()

The following examples show how to use com.sun.org.apache.xml.internal.resolver.Catalog#parseCatalog() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XmlUtil.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    Catalog catalog = manager.getCatalog();
    try {
        if (catalogUrl != null) {
            catalog.parseCatalog(catalogUrl);
        }
    } catch (IOException e) {
        throw new ServerRtException("server.rt.err",e);
    }
    return workaroundCatalogResolver(catalog);
}
 
Example 2
Source File: XmlUtil.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    Catalog catalog = manager.getCatalog();
    try {
        if (catalogUrl != null) {
            catalog.parseCatalog(catalogUrl);
        }
    } catch (IOException e) {
        throw new ServerRtException("server.rt.err",e);
    }
    return workaroundCatalogResolver(catalog);
}
 
Example 3
Source File: XMLCatalogResolver.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 4
Source File: XmlUtil.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    Catalog catalog = manager.getCatalog();
    try {
        if (catalogUrl != null) {
            catalog.parseCatalog(catalogUrl);
        }
    } catch (IOException e) {
        throw new ServerRtException("server.rt.err",e);
    }
    return workaroundCatalogResolver(catalog);
}
 
Example 5
Source File: XMLCatalogResolver.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 6
Source File: XMLCatalogResolver.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 7
Source File: XmlUtil.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    Catalog catalog = manager.getCatalog();
    try {
        if (catalogUrl != null) {
            catalog.parseCatalog(catalogUrl);
        }
    } catch (IOException e) {
        throw new ServerRtException("server.rt.err",e);
    }
    return workaroundCatalogResolver(catalog);
}
 
Example 8
Source File: XMLCatalogResolver.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 9
Source File: XMLCatalogResolver.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 10
Source File: XMLCatalogResolver.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 11
Source File: XMLCatalogResolver.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 12
Source File: XMLCatalogResolver.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 13
Source File: XMLCatalogResolver.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Instruct the <code>Catalog</code> to parse each of the
 * catalogs in the list. Only the first catalog will actually be
 * 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);
            }
        }
    }
    else {
        fCatalog = null;
    }
}
 
Example 14
Source File: XmlUtil.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
 */
public static EntityResolver createDefaultCatalogResolver() {

    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    // parse the catalog
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Enumeration<URL> catalogEnum;
    Catalog catalog = manager.getCatalog();
    try {
        if (cl == null) {
            catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
        } else {
            catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
        }

        while(catalogEnum.hasMoreElements()) {
            URL url = catalogEnum.nextElement();
            catalog.parseCatalog(url);
        }
    } catch (IOException e) {
        throw new WebServiceException(e);
    }

    return workaroundCatalogResolver(catalog);
}
 
Example 15
Source File: XmlUtil.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
 */
public static EntityResolver createDefaultCatalogResolver() {

    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    // parse the catalog
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Enumeration<URL> catalogEnum;
    Catalog catalog = manager.getCatalog();
    try {
        if (cl == null) {
            catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
        } else {
            catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
        }

        while(catalogEnum.hasMoreElements()) {
            URL url = catalogEnum.nextElement();
            catalog.parseCatalog(url);
        }
    } catch (IOException e) {
        throw new WebServiceException(e);
    }

    return workaroundCatalogResolver(catalog);
}
 
Example 16
Source File: XmlUtil.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
 */
public static EntityResolver createDefaultCatalogResolver() {

    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    // parse the catalog
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Enumeration<URL> catalogEnum;
    Catalog catalog = manager.getCatalog();
    try {
        if (cl == null) {
            catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
        } else {
            catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
        }

        while(catalogEnum.hasMoreElements()) {
            URL url = catalogEnum.nextElement();
            catalog.parseCatalog(url);
        }
    } catch (IOException e) {
        throw new WebServiceException(e);
    }

    return workaroundCatalogResolver(catalog);
}
 
Example 17
Source File: XmlUtil.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
 */
public static EntityResolver createDefaultCatalogResolver() {

    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    // parse the catalog
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Enumeration<URL> catalogEnum;
    Catalog catalog = manager.getCatalog();
    try {
        if (cl == null) {
            catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
        } else {
            catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
        }

        while(catalogEnum.hasMoreElements()) {
            URL url = catalogEnum.nextElement();
            catalog.parseCatalog(url);
        }
    } catch (IOException e) {
        throw new WebServiceException(e);
    }

    return workaroundCatalogResolver(catalog);
}
 
Example 18
Source File: XmlUtil.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
 */
public static EntityResolver createDefaultCatalogResolver() {

    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    // parse the catalog
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Enumeration<URL> catalogEnum;
    Catalog catalog = manager.getCatalog();
    try {
        if (cl == null) {
            catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
        } else {
            catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
        }

        while(catalogEnum.hasMoreElements()) {
            URL url = catalogEnum.nextElement();
            catalog.parseCatalog(url);
        }
    } catch (IOException e) {
        throw new WebServiceException(e);
    }

    return workaroundCatalogResolver(catalog);
}
 
Example 19
Source File: XmlUtil.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
 */
public static EntityResolver createDefaultCatalogResolver() {

    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    // parse the catalog
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Enumeration<URL> catalogEnum;
    Catalog catalog = manager.getCatalog();
    try {
        if (cl == null) {
            catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
        } else {
            catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
        }

        while(catalogEnum.hasMoreElements()) {
            URL url = catalogEnum.nextElement();
            catalog.parseCatalog(url);
        }
    } catch (IOException e) {
        throw new WebServiceException(e);
    }

    return workaroundCatalogResolver(catalog);
}
 
Example 20
Source File: XmlUtil.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
 */
public static EntityResolver createDefaultCatalogResolver() {

    // set up a manager
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    // Using static catalog may  result in to sharing of the catalog by multiple apps running in a container
    manager.setUseStaticCatalog(false);
    // parse the catalog
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Enumeration<URL> catalogEnum;
    Catalog catalog = manager.getCatalog();
    try {
        if (cl == null) {
            catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
        } else {
            catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
        }

        while(catalogEnum.hasMoreElements()) {
            URL url = catalogEnum.nextElement();
            catalog.parseCatalog(url);
        }
    } catch (IOException e) {
        throw new WebServiceException(e);
    }

    return workaroundCatalogResolver(catalog);
}