public function listDirectory($directory, $recursive = false)
    {
        $results = $this->scanDirectory($directory, $recursive);

        if (false === $results) {
            throw new \RuntimeException(sprintf(
                'Unable to list directory "%s", maybe it is not a directory '.
                'or it does not exist.',
                $directory
            ));
        }

        return array(
            'files'       => $results[0],
            'directories' => $results[1]
        );
    }