/** * Gets the resource with the specified class loader. * * @param loader * @param resource * @return Returns URL. * @throws ClassNotFoundException */ static public URL getResource(ClassLoader loader, String resource) throws ClassNotFoundException { URL url = null; try { if (loader != null) { log.debug("Trying to find [" + resource + "] using " + loader + " class loader."); url = loader.getResource(resource); if (url != null) { return url; } } } catch (Throwable t) { log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", t); } return getResource(resource); }
public AxisConfiguration getAxisConfiguration() throws AxisFault { InputStream configStream = Loader.getResourceAsStream("org/apache/axis2/transport/axis2.xml"); try { axisConfig = populateAxisConfiguration(configStream); } finally { try { configStream.close(); } catch (IOException ex) { throw AxisFault.makeFault(ex); } } try { loadRepositoryFromURL(new URL(Loader.getResource("org/apache/axis2/transport/repo/__root__"), ".")); } catch (MalformedURLException ex) { throw AxisFault.makeFault(ex); } axisConfig.setConfigurator(this); return axisConfig; }
public AxisConfiguration getAxisConfiguration() throws AxisFault { InputStream configStream = Loader.getResourceAsStream("org/apache/axis2/transport/axis2.xml"); try { axisConfig = populateAxisConfiguration(configStream); } finally { try { configStream.close(); } catch (IOException ex) { throw AxisFault.makeFault(ex); } } try { loadRepositoryFromURL(new URL(Loader.getResource("org/apache/axis2/transport/repo/__root__"), ".")); } catch (MalformedURLException ex) { throw AxisFault.makeFault(ex); } axisConfig.setConfigurator(this); return axisConfig; }
/** * Gets the resource with the specified class loader. * * @param loader * @param resource * @return Returns URL. * @throws ClassNotFoundException */ static public URL getResource(ClassLoader loader, String resource) throws ClassNotFoundException { URL url = null; try { if (loader != null) { log.debug("Trying to find [" + resource + "] using " + loader + " class loader."); url = loader.getResource(resource); if (url != null) { return url; } } } catch (Throwable t) { log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", t); } return getResource(resource); }
public AxisConfiguration getAxisConfiguration() throws AxisFault { URL axis2Url = Loader.getResource("org/apache/axis2/transport/repo/axis2.xml"); try { InputStream configStream = axis2Url.openStream(); try { axisConfig = populateAxisConfiguration(configStream); } finally { configStream.close(); } loadRepositoryFromURL(new URL(axis2Url, ".")); } catch (IOException ex) { throw AxisFault.makeFault(ex); } axisConfig.setConfigurator(this); return axisConfig; }