return inputStream2;
}
private void processLocaleFile( final IPlatformImportBundle bundle, String domainId ) throws PlatformImportException {
final String fullFilename = RepositoryFilenameUtils.concat( "/", bundle.getName() );
final PentahoMetadataFileInfo info = new PentahoMetadataFileInfo( fullFilename );
if ( domainId == null ) {
// try to resolve domainId from bundle
domainId = (String) bundle.getProperty( "domain-id" );
}
if ( domainId == null ) {
throw new PlatformImportException( "Bundle missing required domain-id property" );
}
try {
log.debug( "Importing [" + info.getPath() + "] as properties - [domain=" + domainId + " : locale="
+ info.getLocale() + "]" );
metadataRepositoryImporter.addLocalizationFile( domainId, info.getLocale(), bundle.getInputStream(), true );
} catch ( Exception e ) {
final String errorMessage =
messages.getErrorString( "MetadataImportHandler.ERROR_0002_IMPORTING_LOCALE_FILE", info.getPath(), domainId,
info.getLocale(), e.getLocalizedMessage() );
log.error( errorMessage, e );
throw new PlatformImportException( errorMessage, e );
}
}