createFileJSON() public method

Given a File object, create an array of its properties and values ready to be transformed to JSON
public createFileJSON ( File $file, Folder $folder = null ) : array
$file File
$folder Folder
return array
 /**
  * Helper method for generating an HTTPResponse based on given JSON
  * 
  * @param array $json
  */
 protected function JSONResponse($json = null)
 {
     if (!$json) {
         $json = $this->file instanceof Folder ? $this->parent->createFolderJSON($this->file) : $this->parent->createFileJSON($this->file);
     }
     return (new SS_HTTPResponse(Convert::array2json($json)))->addHeader('Content-Type', 'application/json');
 }