Package com.acciente.induction.init.config

Examples of com.acciente.induction.init.config.ConfigLoaderException


      InputStream oResourceStream = null;
      Config      oConfig;

      if ( _sResourceName == null )
      {
         throw new ConfigLoaderException( "config-load: no resource to load the config specified!" );
      }

      try
      {
         oResourceStream = _oResourceLoader.getResourceAsStream( _sResourceName );

         if ( oResourceStream == null )
         {
            throw new ConfigLoaderException( "config-load: error opening: " + _sResourceName );
         }

         // load the configuration into a new Config object
         DigesterFactory.getDigester( oConfig = new Config(), _oResourceLoader ).parse( oResourceStream );
      }
      catch ( IOException e )
      {
         throw new ConfigLoaderException( "config-load: I/O error on: " + _sResourceName, e );
      }
      catch ( SAXException e )
      {
         throw new ConfigLoaderException( "config-load: XML parse error in: " + _sResourceName, e );
      }
      finally
      {
         try
         {
            if ( oResourceStream != null )
            {
               oResourceStream.close();
            }
         }
         catch ( IOException e )
         {
            throw new ConfigLoaderException( "config-load: stream close error on: " + _sResourceName, e );
         }
      }

      return oConfig;
   }
View Full Code Here

TOP

Related Classes of com.acciente.induction.init.config.ConfigLoaderException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.