class PartitionedIndexStorage {

    public Map<File,Directory> openIndexDirectories() throws IOException
    {
        Map<File,Directory> directories = new LinkedHashMap<>();
        try
        {
            for ( File dir : listFolders() )
            {
                directories.put( dir, directoryFactory.open( dir ) );
            }
        }
        catch ( IOException oe )
        {
            try
            {
                IOUtils.closeAll( directories.values() );
            }
            catch ( Exception ce )
            {
                oe.addSuppressed( ce );
            }
            throw oe;
        }
        return directories;
    }

    public  PartitionedIndexStorage( DirectoryFactory directoryFactory, FileSystemAbstraction fileSystem, File rootFolder );

}