protected function jsonResponse($json = null)
    {
        if (!$json) {
            $json = $this->file instanceof Folder ? $this->parent->createFolderJson($this->file)
                : $this->parent->createFileJson($this->file);
        }

        $response = new SS_HTTPResponse(
            Convert::array2json($json), 200
        );

        return $response->addHeader('Content-Type', 'application/json');
    }