public function ls($resource, $mode = self::LS_MODE_FILE, $recursive = false, $filter = null)
    {
        $files = [];
        list (, $paths, $path) = $this->_parse($resource);

        foreach ((array) $paths as $_path) {
            if (file_exists($_path . '/' . $path)) {
                foreach ($this->_list(FS::clean($_path . '/' . $path), '', $mode, $recursive, $filter) as $file) {
                    if (!Arr::in($file, $files)) {
                        $files[] = $file;
                    }
                }
            }
        }

        return $files;
    }