PentahoMetadataDomainRepository implements IMetadataDomainRepository,
  IModelAnnotationsAwareMetadataDomainRepositoryImporter,
  IAclAwarePentahoMetadataDomainRepositoryImporter, IPentahoMetadataDomainRepositoryExporter { public Map<String, InputStream> getDomainFilesData( final String domainId ) { lock.readLock().lock(); try { if ( !metadataMapping.getDomainIds().contains( domainId ) ) { return emptyMap(); } Map<String, InputStream> localeFiles = ofNullable( metadataMapping.getLocaleFiles( domainId ) ).orElse( emptyMap() ).entrySet().stream() .collect( toMap( entry -> "messages_" + entry.getKey() + ".properties", item -> getRepositoryFileInputStream( item.getValue() ) ) ); Map<String, InputStream> map = new HashMap<>( localeFiles ); map.put( getXmiFilename( domainId ), getRepositoryFileInputStream( metadataMapping.getDomainFile( domainId ) ) ); return map; } finally { lock.readLock().unlock(); } } PentahoMetadataDomainRepository( final IUnifiedRepository repository ); protected  PentahoMetadataDomainRepository( final IUnifiedRepository repository,
                                             final RepositoryUtils repositoryUtils, final XmiParser xmiParser,
                                             final LocalizationUtil localizationUtil ); @Override void storeDomain( final Domain domain, final boolean overwrite ); @Override void storeDomain( final InputStream inputStream, final String domainId, final boolean overwrite ); @Override void storeDomain( InputStream inputStream, String domainId, boolean overwrite, RepositoryFileAcl acl ); @Override void setAclFor( String domainId, RepositoryFileAcl acl ); @Override RepositoryFileAcl getAclFor( String domainId ); @Override boolean hasAccessFor( String domainId ); Map<String, InputStream> getDomainFilesData( final String domainId ); @Override Domain getDomain( final String domainId ); @Override Set<String> getDomainIds(); @Override void removeDomain( final String domainId ); @Override void removeModel( final String domainId, final String modelId ); @Override void reloadDomains(); @Override void flushDomains(); @Override String generateRowLevelSecurityConstraint( final LogicalModel model ); @Override boolean hasAccess( final int accessType, final IConcept aclHolder ); void addLocalizationFile( final String domainId, final String locale, final Properties properties ); @Override void addLocalizationFile( final String domainId, final String locale, final InputStream inputStream,
                                   final boolean overwrite ); @Override String loadAnnotationsXml( final String domainId ); @Override void storeAnnotationsXml( String domainId, String annotationsXml ); RepositoryFile getAnnotationsXmlFile( final RepositoryFile domainFile ); void createOrUpdateAnnotationsXml( final RepositoryFile domainFile, final RepositoryFile annotationsFile,
                                            final String annotationsXml );  }
@Test public void testGetDomainFilesNoSuchDomain() { assertTrue( domainRepos.getDomainFilesData( "NOSUCH_DOMAIN" ).isEmpty() ); }
@Test public void testGetDomainFiles() { Map<String, InputStream> domainFiles = domainRepos.getDomainFilesData( "testDomain1.xmi" ); assertThat( domainFiles.size(), equalTo( 3 ) ); assertThat( domainFiles.keySet().stream().sorted().collect( Collectors.joining( "," ) ), equalTo( "messages_fr_FR.properties,messages_ja.properties,testDomain1.xmi" ) ); domainFiles = domainRepos.getDomainFilesData( "testDomain_noLocaleFiles.xmi" ); assertThat( domainFiles.size(), equalTo( 1 ) ); assertThat( domainFiles.keySet().stream().sorted().collect( Collectors.joining( "," ) ), equalTo( "testDomain_noLocaleFiles.xmi" ) ); domainFiles = domainRepos.getDomainFilesData( "testDomain_doesntEndIn_dotXMI" ); assertThat( domainFiles.size(), equalTo( 1 ) ); assertThat( domainFiles.keySet().stream().sorted().collect( Collectors.joining( "," ) ), equalTo( "testDomain_doesntEndIn_dotXMI.xmi" ) ); }