public static InputStream getConfigStream ( String properties ) throws IOException { InputStream configStream = null ; // Check to see if the properties string is the name of a file. try { configStream = new FileInputStream ( properties ) ; } catch ( FileNotFoundException | AccessControlException fnfe ) { // the properties string is likely not a file } // Check to see if the properties string is a URL. if ( configStream == null ) { try { configStream = new URL ( properties ) . openStream ( ) ; } catch ( MalformedURLException mre ) { // the properties string is not a URL } } // Check to see if the properties string is the name of a resource, e.g. udp.xml. if ( configStream == null && properties . endsWith ( "xml" ) ) configStream = Util . getResourceAsStream ( properties , ConfiguratorFactory . class ) ; return configStream ; }
Returns a JGroups XML configuration InputStream based on the provided properties string .