protected function deleteContents($path)
    {
        $contents = $this->listContents($path, true);

        foreach (array_reverse($contents) as $object) {
            $location = $this->applyPathPrefix($object['path']);

            if ($object['type'] === 'dir') {
                $this->share->rmdir($location);
            } else {
                $this->share->del($location);
            }
        }
    }