MIME

com.alecdorrington.assetloader.MIME
object MIME

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MIME.type

Members list

Value members

Concrete methods

def contentType(file: Path, charset: String = ...): String

Determines the content type of a file based on the extension.

Determines the content type of a file based on the extension.

Resolution is based on the first of the following to succeed:

  1. A custom lookup of common web formats.
  2. java.nio.file.Files.probeContentType
  3. application/octet-stream

Value parameters

charset

The name of the character encoding used for text files, defaulting to utf-8.

file

The path of the file.

Attributes