Java Code Examples for com.sun.org.apache.xml.internal.resolver.CatalogManager#setUseStaticCatalog()
The following examples show how to use
com.sun.org.apache.xml.internal.resolver.CatalogManager#setUseStaticCatalog() .
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 |
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: MavenCatalogResolverTest.java From maven-jaxb2-plugin with BSD 2-Clause "Simplified" License | 6 votes |
@Test public void checkReenterability() throws IOException { CatalogManager cma = new CatalogManager(); cma.setIgnoreMissingProperties(true); cma.setUseStaticCatalog(false); final CatalogResolver cra = new CatalogResolver(cma); URL a = getClass().getResource("a/catalog.cat"); cra.getCatalog().parseCatalog(a); InputSource ea = cra.resolveEntity(null, "http://www.w3.org/1999/xlink.xsd"); Assert.assertNotNull(ea); CatalogManager cmb = new CatalogManager(); cmb.setIgnoreMissingProperties(true); cmb.setUseStaticCatalog(false); final CatalogResolver crb = new CatalogResolver(cmb); URL b = getClass().getResource("b/catalog.cat"); crb.getCatalog().parseCatalog(b); InputSource eb = crb.resolveEntity(null, "http://www.w3.org/2005/atom-author-link.xsd"); Assert.assertNotNull(eb); }
Example 3
Source File: XMLCatalogResolver.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Initialization. Create a CatalogManager and set all * the properties upfront. This prevents JVM wide system properties * or a property file somewhere in the environment from affecting * the behaviour of this catalog resolver. */ private void init (String [] catalogs, boolean preferPublic) { fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null; fPreferPublic = preferPublic; fResolverCatalogManager = new CatalogManager(); fResolverCatalogManager.setAllowOasisXMLCatalogPI(false); fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog"); fResolverCatalogManager.setCatalogFiles(""); fResolverCatalogManager.setIgnoreMissingProperties(true); fResolverCatalogManager.setPreferPublic(fPreferPublic); fResolverCatalogManager.setRelativeCatalogs(false); fResolverCatalogManager.setUseStaticCatalog(false); fResolverCatalogManager.setVerbosity(0); }
Example 4
Source File: XMLCatalogResolver.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Initialization. Create a CatalogManager and set all * the properties upfront. This prevents JVM wide system properties * or a property file somewhere in the environment from affecting * the behaviour of this catalog resolver. */ private void init (String [] catalogs, boolean preferPublic) { fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null; fPreferPublic = preferPublic; fResolverCatalogManager = new CatalogManager(); fResolverCatalogManager.setAllowOasisXMLCatalogPI(false); fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog"); fResolverCatalogManager.setCatalogFiles(""); fResolverCatalogManager.setIgnoreMissingProperties(true); fResolverCatalogManager.setPreferPublic(fPreferPublic); fResolverCatalogManager.setRelativeCatalogs(false); fResolverCatalogManager.setUseStaticCatalog(false); fResolverCatalogManager.setVerbosity(0); }
Example 5
Source File: XmlUtil.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Default CatalogResolver implementation is broken as it depends on CatalogManager.getCatalog() which will always create a new one when * useStaticCatalog is false. * This returns a CatalogResolver that uses the catalog passed as parameter. * @param catalog * @return CatalogResolver */ private static CatalogResolver workaroundCatalogResolver(final Catalog catalog) { // set up a manager CatalogManager manager = new CatalogManager() { @Override public Catalog getCatalog() { return catalog; } }; manager.setIgnoreMissingProperties(true); // Using static catalog may result in to sharing of the catalog by multiple apps running in a container manager.setUseStaticCatalog(false); return new CatalogResolver(manager); }
Example 6
Source File: XmlUtil.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * 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 7
Source File: XmlUtil.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Default CatalogResolver implementation is broken as it depends on CatalogManager.getCatalog() which will always create a new one when * useStaticCatalog is false. * This returns a CatalogResolver that uses the catalog passed as parameter. * @param catalog * @return CatalogResolver */ private static CatalogResolver workaroundCatalogResolver(final Catalog catalog) { // set up a manager CatalogManager manager = new CatalogManager() { @Override public Catalog getCatalog() { return catalog; } }; manager.setIgnoreMissingProperties(true); // Using static catalog may result in to sharing of the catalog by multiple apps running in a container manager.setUseStaticCatalog(false); return new CatalogResolver(manager); }
Example 8
Source File: EntityResolverFactory.java From java-9-wtf with Apache License 2.0 | 5 votes |
private static EntityResolver asInPlugin() { // works on Java 9 - WHY?! final CatalogManager catalogManager = new CatalogManager(); catalogManager.setIgnoreMissingProperties(true); catalogManager.setUseStaticCatalog(false); MavenCatalogResolver catalogResolver = new MavenCatalogResolver( catalogManager, new UoeDependencyResourceResolver()); return new ReResolvingEntityResolverWrapper(catalogResolver); }
Example 9
Source File: EntityResolverFactory.java From java-9-wtf with Apache License 2.0 | 5 votes |
private static EntityResolver withConfiguredSimpleCatalogManager() { // works on Java 9 final CatalogManager catalogManager = new CatalogManager(); catalogManager.setIgnoreMissingProperties(true); catalogManager.setUseStaticCatalog(false); return new CatalogResolver(catalogManager); }
Example 10
Source File: XmlUtil.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Default CatalogResolver implementation is broken as it depends on CatalogManager.getCatalog() which will always create a new one when * useStaticCatalog is false. * This returns a CatalogResolver that uses the catalog passed as parameter. * @param catalog * @return CatalogResolver */ private static CatalogResolver workaroundCatalogResolver(final Catalog catalog) { // set up a manager CatalogManager manager = new CatalogManager() { @Override public Catalog getCatalog() { return catalog; } }; manager.setIgnoreMissingProperties(true); // Using static catalog may result in to sharing of the catalog by multiple apps running in a container manager.setUseStaticCatalog(false); return new CatalogResolver(manager); }
Example 11
Source File: XMLCatalogResolver.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Initialization. Create a CatalogManager and set all * the properties upfront. This prevents JVM wide system properties * or a property file somewhere in the environment from affecting * the behaviour of this catalog resolver. */ private void init (String [] catalogs, boolean preferPublic) { fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null; fPreferPublic = preferPublic; fResolverCatalogManager = new CatalogManager(); fResolverCatalogManager.setAllowOasisXMLCatalogPI(false); fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog"); fResolverCatalogManager.setCatalogFiles(""); fResolverCatalogManager.setIgnoreMissingProperties(true); fResolverCatalogManager.setPreferPublic(fPreferPublic); fResolverCatalogManager.setRelativeCatalogs(false); fResolverCatalogManager.setUseStaticCatalog(false); fResolverCatalogManager.setVerbosity(0); }
Example 12
Source File: XmlUtil.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Default CatalogResolver implementation is broken as it depends on CatalogManager.getCatalog() which will always create a new one when * useStaticCatalog is false. * This returns a CatalogResolver that uses the catalog passed as parameter. * @param catalog * @return CatalogResolver */ private static CatalogResolver workaroundCatalogResolver(final Catalog catalog) { // set up a manager CatalogManager manager = new CatalogManager() { @Override public Catalog getCatalog() { return catalog; } }; manager.setIgnoreMissingProperties(true); // Using static catalog may result in to sharing of the catalog by multiple apps running in a container manager.setUseStaticCatalog(false); return new CatalogResolver(manager); }
Example 13
Source File: XMLCatalogResolver.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Initialization. Create a CatalogManager and set all * the properties upfront. This prevents JVM wide system properties * or a property file somewhere in the environment from affecting * the behaviour of this catalog resolver. */ private void init (String [] catalogs, boolean preferPublic) { fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null; fPreferPublic = preferPublic; fResolverCatalogManager = new CatalogManager(); fResolverCatalogManager.setAllowOasisXMLCatalogPI(false); fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog"); fResolverCatalogManager.setCatalogFiles(""); fResolverCatalogManager.setIgnoreMissingProperties(true); fResolverCatalogManager.setPreferPublic(fPreferPublic); fResolverCatalogManager.setRelativeCatalogs(false); fResolverCatalogManager.setUseStaticCatalog(false); fResolverCatalogManager.setVerbosity(0); }
Example 14
Source File: XMLCatalogResolver.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Initialization. Create a CatalogManager and set all * the properties upfront. This prevents JVM wide system properties * or a property file somewhere in the environment from affecting * the behaviour of this catalog resolver. */ private void init (String [] catalogs, boolean preferPublic) { fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null; fPreferPublic = preferPublic; fResolverCatalogManager = new CatalogManager(); fResolverCatalogManager.setAllowOasisXMLCatalogPI(false); fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog"); fResolverCatalogManager.setCatalogFiles(""); fResolverCatalogManager.setIgnoreMissingProperties(true); fResolverCatalogManager.setPreferPublic(fPreferPublic); fResolverCatalogManager.setRelativeCatalogs(false); fResolverCatalogManager.setUseStaticCatalog(false); fResolverCatalogManager.setVerbosity(0); }
Example 15
Source File: XmlUtil.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Default CatalogResolver implementation is broken as it depends on CatalogManager.getCatalog() which will always create a new one when * useStaticCatalog is false. * This returns a CatalogResolver that uses the catalog passed as parameter. * @param catalog * @return CatalogResolver */ private static CatalogResolver workaroundCatalogResolver(final Catalog catalog) { // set up a manager CatalogManager manager = new CatalogManager() { @Override public Catalog getCatalog() { return catalog; } }; manager.setIgnoreMissingProperties(true); // Using static catalog may result in to sharing of the catalog by multiple apps running in a container manager.setUseStaticCatalog(false); return new CatalogResolver(manager); }
Example 16
Source File: XmlUtil.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * 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-source with GNU General Public License v2.0 | 5 votes |
/** * Default CatalogResolver implementation is broken as it depends on CatalogManager.getCatalog() which will always create a new one when * useStaticCatalog is false. * This returns a CatalogResolver that uses the catalog passed as parameter. * @param catalog * @return CatalogResolver */ private static CatalogResolver workaroundCatalogResolver(final Catalog catalog) { // set up a manager CatalogManager manager = new CatalogManager() { @Override public Catalog getCatalog() { return catalog; } }; manager.setIgnoreMissingProperties(true); // Using static catalog may result in to sharing of the catalog by multiple apps running in a container manager.setUseStaticCatalog(false); return new CatalogResolver(manager); }
Example 18
Source File: XMLCatalogResolver.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Initialization. Create a CatalogManager and set all * the properties upfront. This prevents JVM wide system properties * or a property file somewhere in the environment from affecting * the behaviour of this catalog resolver. */ private void init (String [] catalogs, boolean preferPublic) { fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null; fPreferPublic = preferPublic; fResolverCatalogManager = new CatalogManager(); fResolverCatalogManager.setAllowOasisXMLCatalogPI(false); fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog"); fResolverCatalogManager.setCatalogFiles(""); fResolverCatalogManager.setIgnoreMissingProperties(true); fResolverCatalogManager.setPreferPublic(fPreferPublic); fResolverCatalogManager.setRelativeCatalogs(false); fResolverCatalogManager.setUseStaticCatalog(false); fResolverCatalogManager.setVerbosity(0); }
Example 19
Source File: XmlUtil.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * 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: XMLCatalogResolver.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Initialization. Create a CatalogManager and set all * the properties upfront. This prevents JVM wide system properties * or a property file somewhere in the environment from affecting * the behaviour of this catalog resolver. */ private void init (String [] catalogs, boolean preferPublic) { fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null; fPreferPublic = preferPublic; fResolverCatalogManager = new CatalogManager(); fResolverCatalogManager.setAllowOasisXMLCatalogPI(false); fResolverCatalogManager.setCatalogClassName("com.sun.org.apache.xml.internal.resolver.Catalog"); fResolverCatalogManager.setCatalogFiles(""); fResolverCatalogManager.setIgnoreMissingProperties(true); fResolverCatalogManager.setPreferPublic(fPreferPublic); fResolverCatalogManager.setRelativeCatalogs(false); fResolverCatalogManager.setUseStaticCatalog(false); fResolverCatalogManager.setVerbosity(0); }