I see. But my tries are not working :-(
Here is a try:
```php
public function listKeys($prefix = '')
{
    $directory = dirname($this->directory . '/' . $prefix. ' ');
    $return = array('keys' => array(), 'dirs' => array());

    $dirIterator = new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS);
    $filter = new Util\ListKeysFilterIterator($dirIterator, $directory);
    $iterator = new \RecursiveIteratorIterator($filter, \RecursiveIteratorIterator::CHILD_FIRST, \RecursiveIteratorIterator::CATCH_GET_CHILD);

    foreach ($iterator as $path) {
        array_push($return[$path->isFile() ? 'keys' : 'dirs'], substr($path->getPathname(), strlen($this->directory) + 1));
    }

    return $return;
}
```
this one is not getting directories. Also, I had to add \RecursiveIteratorIterator::CATCH_GET_CHILD, otherwise I'm getting an exception that ListKeysFilterIterator is missing second parameter (wondering why...)