MimeTypes

object MimeTypes extends Mimes
trait Mimes
class Object
trait Matchable
class Any

Value members

Inherited methods

def apply(uri: URI): String
Inherited from:
Mimes
def apply(bytes: Array[Byte]): String
Inherited from:
Mimes
def apply(file: File): String
Inherited from:
Mimes
def apply(input: InputStream): String
Inherited from:
Mimes
def bytesMime(content: Array[Byte], fallback: String): String

Detects the mime type of a given Byte array.

Detects the mime type of a given Byte array.

When inappropriate MIME Type can not be inferred, "text/pain" is returned.

Value parameters:
content

The Byte array for which to detect the mime type

fallback

A fallback value in case no mime type can be found

Inherited from:
Mimes
def fileMime(file: File, fallback: String): String

Detects the mime type of a given File.

Detects the mime type of a given File.

When inappropriate MIME Type can not be inferred, "application/octet-stream" is returned.

This method guesses the MIME type using java.net.URLConnection.guessContentTypeFromName. Therefore, by defining an arbitrary MIME type in the configuration file specified by the content.types.user.table property, an arbitrary MIME type can be guessed.

Value parameters:
fallback

A fallback value in case no mime type can be found

file

The File for which to detect the mime type

Inherited from:
Mimes
def inputStreamMime(input: InputStream, fallback: String): String

Detects the mime type of a given InputStream.

Detects the mime type of a given InputStream.

When inappropriate MIME Type can not be inferred, "application/octet-stream" is returned.

Value parameters:
fallback

A fallback value in case no mime type can be found

input

The InputStream for which to detect the mime type

Inherited from:
Mimes
def urlMime(url: String, fallback: String): String

Detects the mime type of a given url.

Detects the mime type of a given url.

When inappropriate MIME Type can not be inferred, "application/octet-stream" is returned.

This method guesses the MIME type using java.net.URLConnection.guessContentTypeFromName. Therefore, by defining an arbitrary MIME type in the configuration file specified by the content.types.user.table property, an arbitrary MIME type can be guessed.

Value parameters:
fallback

A fallback value in case no mime type can be found

url

The url for which to detect the mime type

Inherited from:
Mimes