public function isPlainText()
    {
        $sc_pos = strpos($this->mime_type, ';');
        if ($sc_pos !== false)
            $mime_type = substr($this->mime_type, 0, $sc_pos);
        else
            $mime_type = $this->mime_type;
        
        // Some application/* types are plain text
        switch ($mime_type)
        {
            case "application/javascript":
            case "application/json":
            case "application/xml":
                return true;
        }

        // Assume all text/* files to be plain text
        return substr($mime_type, 0, 5) === "text/";
    }