public function findFilesystemByName($name, Directory $inDirectory = null)
    {
        $name = '/'.ltrim($name, '/');
        $directory = dirname($name);
        $directory = str_replace('\\', '/', $directory); // Issue #7

        if ($inDirectory) {
            $name      = sprintf("/%s", ltrim($inDirectory->getRealpath().$name, '/'));
            $directory = $inDirectory;
        }

        return $this->findOneBy($directory, function ($item) use ($name) {
            return $name == $item->getRealpath();
        });
    }