protected function createFile($filename, $class) {
    $filename = trim($filename);
    $file = $class::create();
    $file->setName($filename);
    $file->Filename = $this->folder . $filename;
    $file->ParentID = $this->folderID;
    $file->write();
    return $file;
  }