/** * Gets the resource with the specified class loader. * * @param loader * @param resource * @return Returns URL. * @throws ClassNotFoundException */ static public InputStream getResourceAsStream(ClassLoader loader, String resource) throws ClassNotFoundException { try { if (loader != null) { log.debug("Trying to find [" + resource + "] using " + loader + " class loader."); InputStream is = loader.getResourceAsStream(resource); if (is != null) { return is; } } } catch (Throwable t) { log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", t); } return getResourceAsStream(resource); }
/** * Gets the resource with the specified class loader. * * @param loader * @param resource * @return Returns URL. * @throws ClassNotFoundException */ static public InputStream getResourceAsStream(ClassLoader loader, String resource) throws ClassNotFoundException { try { if (loader != null) { log.debug("Trying to find [" + resource + "] using " + loader + " class loader."); InputStream is = loader.getResourceAsStream(resource); if (is != null) { return is; } } } catch (Throwable t) { log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", t); } return getResourceAsStream(resource); }
+ DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE + " from classpath"); axis2Stream = Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
+ DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE + " from classpath"); axis2Stream = Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
} else { configStream = Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_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; }
if (axis2xml == null) { axis2xmlStream = Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE); } else { axis2xmlStream = axis2xml.openStream();
if (axis2xml == null) { axis2xmlStream = Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE); } else { axis2xmlStream = axis2xml.openStream();
} else { configStream = Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
/** * Creates configuration context using resource file found in the classpath. * * @return Returns ConfigurationContext. */ public static ConfigurationContext createBasicConfigurationContext(String resourceName) throws Exception { InputStream in = Loader.getResourceAsStream(resourceName); AxisConfiguration axisConfig = new AxisConfiguration(); AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, null); builder.populateConfig(); axisConfig.validateSystemPredefinedPhases(); ConfigurationContext configContext = new ConfigurationContext(axisConfig); if (axisConfig.getClusteringAgent() != null) { configContext.initCluster(); } setContextPaths(axisConfig, configContext); return configContext; } }
/** * Creates configuration context using resource file found in the classpath. * * @return Returns ConfigurationContext. */ public static ConfigurationContext createBasicConfigurationContext(String resourceName) throws Exception { InputStream in = Loader.getResourceAsStream(resourceName); AxisConfiguration axisConfig = new AxisConfiguration(); AxisConfigBuilder builder = new AxisConfigBuilder(in, axisConfig, null); builder.populateConfig(); axisConfig.validateSystemPredefinedPhases(); ConfigurationContext configContext = new ConfigurationContext(axisConfig); if (axisConfig.getClusteringAgent() != null) { configContext.initCluster(); } setContextPaths(axisConfig, configContext); return configContext; } }