/** * How are missing properties handled? * * <p>If ignore is true, missing or unreadable property files will * not be reported. Otherwise, a message will be sent to System.err. * </p> * * @deprecated No longer static; use get/set methods. */ public void ignoreMissingProperties(boolean ignore) { setIgnoreMissingProperties(ignore); }
/** * How are missing properties handled? * * <p>If ignore is true, missing or unreadable property files will * not be reported. Otherwise, a message will be sent to System.err. * </p> * * @deprecated No longer static; use get/set methods. */ public void ignoreMissingProperties(boolean ignore) { setIgnoreMissingProperties(ignore); }
/** * How are missing properties handled? * * <p>If ignore is true, missing or unreadable property files will * not be reported. Otherwise, a message will be sent to System.err. * </p> * * @deprecated No longer static; use get/set methods. */ public void ignoreMissingProperties(boolean ignore) { setIgnoreMissingProperties(ignore); }
/** * How are missing properties handled? * * <p>If ignore is true, missing or unreadable property files will * not be reported. Otherwise, a message will be sent to System.err. * </p> * * @deprecated No longer static; use get/set methods. */ public void ignoreMissingProperties(boolean ignore) { setIgnoreMissingProperties(ignore); }
/** * Adds a new catalog file. */ public void addCatalog(File catalogFile) throws IOException { if(entityResolver==null) { CatalogManager.getStaticManager().setIgnoreMissingProperties(true); entityResolver = new CatalogResolver(true); } ((CatalogResolver)entityResolver).getCatalog().parseCatalog(catalogFile.getPath()); }
/** * Default CatalogResolver implementation is broken as it depends on * CatalogManager.getCatalog() which will always create 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); }
/** * Adds a new catalog file. */ public void addCatalog(File catalogFile) throws IOException { if(entityResolver==null) { CatalogManager.getStaticManager().setIgnoreMissingProperties(true); entityResolver = new CatalogResolver(true); } ((CatalogResolver)entityResolver).getCatalog().parseCatalog(catalogFile.getPath()); }
private static EntityResolver withConfiguredSimpleCatalogManager() { // works on Java 9 final CatalogManager catalogManager = new CatalogManager(); catalogManager.setIgnoreMissingProperties(true); catalogManager.setUseStaticCatalog(false); return new CatalogResolver(catalogManager); }
/** * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml * @return */ 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); }
static EntityResolver getCatalog(EntityResolver entityResolver, File catalogFile, ArrayList<URI> catalogUrls) throws IOException { EntityResolver er = entityResolver; if (er == null) { final CatalogManager staticManager = CatalogManager.getStaticManager(); // hack to force initialization so catalog manager system properties take effect staticManager.getVerbosity(); staticManager.setIgnoreMissingProperties(true); er = new CatalogResolver(true); } ((CatalogResolver) er).getCatalog().parseCatalog(catalogFile.getPath()); return er; } }
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); }
/** * Creates an instance of catalog resolver. * * @return Instance of the catalog resolver. * @throws MojoExecutionException * If catalog resolver cannot be instantiated. */ protected CatalogResolver createCatalogResolver() throws MojoExecutionException { final CatalogManager catalogManager = new CatalogManager(); catalogManager.setIgnoreMissingProperties(true); catalogManager.setUseStaticCatalog(false); // TODO Logging if (getLog().isDebugEnabled()) { catalogManager.setVerbosity(Integer.MAX_VALUE); } if (getCatalogResolver() == null) { return new MavenCatalogResolver(catalogManager, this, getLog()); } else { final String catalogResolverClassName = getCatalogResolver().trim(); return createCatalogResolverByClassName(catalogResolverClassName); } }
/** * Creates an instance of catalog resolver. * * @return Instance of the catalog resolver. * @throws MojoExecutionException * If catalog resolver cannot be instantiated. */ protected CatalogResolver createCatalogResolver() throws MojoExecutionException { final CatalogManager catalogManager = new CatalogManager(); catalogManager.setIgnoreMissingProperties(true); catalogManager.setUseStaticCatalog(false); // TODO Logging if (getLog().isDebugEnabled()) { catalogManager.setVerbosity(Integer.MAX_VALUE); } if (getCatalogResolver() == null) { return new MavenCatalogResolver(catalogManager, this, getLog()); } else { final String catalogResolverClassName = getCatalogResolver().trim(); return createCatalogResolverByClassName(catalogResolverClassName); } }
/** * Gets an EntityResolver using XML catalog * @param catalogUrl * @return */ 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); }
/** * 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); }
/** * 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); }
try { if(options.entityResolver==null) { CatalogManager.getStaticManager().setIgnoreMissingProperties(true); options.entityResolver = new CatalogResolver(true);