public function createFileJson(File $file, $folder = null)
    {
        $isImage = $file instanceof Image;
        $w = $isImage ? self::IMAGE_WIDTH : self::ICON_SIZE;
        $h = $isImage ? self::IMAGE_HEIGHT : self::ICON_SIZE;
        $folder = $folder ?: $file->Parent();

        return array(
            'id' => $file->ID,
            'parentID' => $file->ParentID,
            'title' => ($file->Title) ? $file->Title : basename($file->Filename),
            'filename' => basename($file->Filename),
            'path' => $file->Filename,
            'filesize' => $file->getAbsoluteSize(),
            'folderName' => $folder->Filename,
            'type' => $isImage ? 'image' : 'file',
            'extension' => $file->getExtension(),
            'created' => $file->Created,
            'updated' => $file->LastEdited,
            'iconURL' => $file->getPreviewThumbnail($w, $h)->URL,
            'canEdit' => $file->canEdit(),
            'canCreate' => $file->canCreate(),
            'canDelete' => $file->canDelete()
        );
    }