MondrianCatalogRepositoryHelper { public Map<String, InputStream> getModrianSchemaFiles( String catalogName ) { Map<String, InputStream> values = new HashMap<String, InputStream>(); RepositoryFile catalogFolder = repository.getFile( ETC_MONDRIAN_JCR_FOLDER + RepositoryFile.SEPARATOR + catalogName ); if ( catalogFolder == null ) { logger.warn( "Catalog " + catalogName + " not found" ); throw new RepositoryException( "Catalog " + catalogName + " not found" ); } for ( RepositoryFile repoFile : repository.getChildren( catalogFolder.getId() ) ) { RepositoryFileInputStream is; if ( repoFile.getName().equals( "metadata" ) ) { continue; } try { is = new RepositoryFileInputStream( repoFile, repository ); } catch ( FileNotFoundException e ) { throw new RepositoryException( e ); } values.put( repoFile.getName(), is ); } if ( values.containsKey( ANNOTATIONS_XML ) && values.containsKey( SCHEMA_XML ) ) { return includeAnnotatedSchema( values ); } return values; } MondrianCatalogRepositoryHelper( final IUnifiedRepository repository ); @Deprecated void addSchema( InputStream mondrianFile, String catalogName, String datasourceInfo ); void addHostedCatalog( InputStream mondrianFile, String catalogName, String datasourceInfo ); void deleteCatalog( String catalogName ); void deleteHostedCatalog( String catalogName ); void addOlap4jServer(
      String name,
      String className,
      String URL,
      String user,
      String password,
      Properties props ); void deleteOlap4jServer( String name ); List<String> getOlap4jServers(); Olap4jServerInfo getOlap4jServerInfo( String name ); List<String> getHostedCatalogs(); HostedCatalogInfo getHostedCatalogInfo( String name ); Map<String, InputStream> getModrianSchemaFiles( String catalogName ); RepositoryFile getMondrianCatalogFile( String catalogName ); boolean hasAccess(
      final String catalogName,
      final EnumSet<RepositoryFilePermission> perms,
      IPentahoSession session ); static final String ETC_MONDRIAN_JCR_FOLDER; static final String ETC_OLAP_SERVERS_JCR_FOLDER; }
@Test( expected = RepositoryException.class ) public void testGetModrianSchemaFilesInvalidCatalogName() { String testCatalogName = "testCatalogName"; when( repository.getFile( ETC_MONDRIAN_JCR_FOLDER + RepositoryFile.SEPARATOR + testCatalogName ) ).thenReturn( null ); mondrianCatalogRepositoryHelper.getModrianSchemaFiles( testCatalogName ); }