URL cfgResource = Cloudloop.class
.getClassLoader( )
.getResource( SCHEMA_RESOURCE_LOCATION );
if ( cfgResource == null )
{
throw new ErrorParsingConfigurationException(
"Could not find embedded configuration schema resource '"
+ SCHEMA_RESOURCE_LOCATION + "'." );
}
Source schemaSource;
try
{
schemaSource = new StreamSource( cfgResource.openStream( ) );
return fac.newSchema( schemaSource );
}
catch ( IOException e )
{
throw new ErrorParsingConfigurationException(
"Error reading embedded configuration schema resource '"
+ SCHEMA_RESOURCE_LOCATION + "'." );
}
catch ( SAXException e )
{
throw new ErrorParsingConfigurationException(
"Error reading embedded configuration schema resource '"
+ SCHEMA_RESOURCE_LOCATION + "'." );
}
}