public function setMimetype($mimetype)
    {
        if ($mimetype instanceof MimeType) {
            $this->mimetype = $mimetype;
        } elseif (is_array($mimetype)) {
            $this->mimetype = new MimeType($mimetype);
        } else {
            $this->mimetype = null;
            trigger_error('Argument must be an object of class MimeType. Data loss!', E_USER_WARNING);
        }

        return $this;
    }