try {
if ( ComponentBase.debug ) {
debug( Messages.getInstance().getString( "Kettle.DEBUG_META_REPOSITORY" ) ); //$NON-NLS-1$
}
RepositoriesMeta repositoriesMeta = null;
try {
repositoriesMeta = new RepositoriesMeta();
} catch ( Exception e ) {
error( Messages.getInstance().getErrorString( "Kettle.ERROR_0007_BAD_META_REPOSITORY" ), e ); //$NON-NLS-1$
return null;
}
/*
* Unreachable code below if (repositoriesMeta == null) {
* error(Messages.getInstance().getErrorString("Kettle.ERROR_0007_BAD_META_REPOSITORY")); //$NON-NLS-1$
* debug(getKettleLog(true)); return null; }
*/
if ( ComponentBase.debug ) {
debug( Messages.getInstance().getString( "Kettle.DEBUG_POPULATING_META" ) ); //$NON-NLS-1$
}
try {
// TODO: add support for specified repositories.xml files...
repositoriesMeta.readData(); // Read from the default
// $HOME/.kettle/repositories.xml
// file.
} catch ( Exception e ) {
error( Messages.getInstance().getErrorString( "Kettle.ERROR_0018_META_REPOSITORY_NOT_POPULATED" ), e ); //$NON-NLS-1$
return null;
}
if ( ( repositoriesXMLFile != null ) && !"".equals( repositoriesXMLFile ) ) //$NON-NLS-1$
{
error( Messages.getInstance().getErrorString( "Kettle.ERROR_0017_XML_REPOSITORY_NOT_SUPPORTED" ) ); //$NON-NLS-1$
debug( getKettleLog( true ) );
return null;
}
if ( ComponentBase.debug ) {
debug( Messages.getInstance().getString( "Kettle.DEBUG_FINDING_REPOSITORY" ) ); //$NON-NLS-1$
}
// Find the specified repository.
RepositoryMeta repositoryMeta = null;
try {
repositoryMeta = repositoriesMeta.findRepository( repositoryName );
} catch ( Exception e ) {
error( Messages.getInstance().getErrorString( "Kettle.ERROR_0004_REPOSITORY_NOT_FOUND", repositoryName ), e ); //$NON-NLS-1$
return null;
}