private static void scanEpisodeFile(File jar, SchemaCompiler sc) throws BadCommandLineException, IOException { URLClassLoader ucl = new URLClassLoader(new URL[] {jar.toURL()}); Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode"); while (resources.hasMoreElements()) { URL url = resources.nextElement(); sc.getOptions().addBindFile(new InputSource(url.toExternalForm())); } }
/** Finds the <tt>META-INF/sun-jaxb.episode</tt> file to add as a binding customization. */ public void scanEpisodeFile(File jar) throws BadCommandLineException { try { URLClassLoader ucl = new URLClassLoader(new URL[] {jar.toURL()}); Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode"); while (resources.hasMoreElements()) { URL url = resources.nextElement(); addBindFile(new InputSource(url.toExternalForm())); } } catch (IOException e) { throw new BadCommandLineException( Messages.format(Messages.FAILED_TO_LOAD, jar, e.getMessage()), e); } }