Behaviours: gen_server.
create/1 | Create a new database of extension-mimetype mappings. |
dmodule/0 | |
ext_to_mimes/1 | Return the set of known mimetypes of an extension. |
ext_to_mimes/2 | Return the set of known mimetypes of an extension. |
extension/1 | Transforms an extension to a list of mimetypes. |
extensions/0 | Return a list of all available extensions. |
extensions/1 | Convert mimetype to a list of extensions. |
filename/1 | Convert a filename to a list of mimetypes. |
load/2 | Load a set of extension-mimetype mappings. |
load/3 | Load a set of extension-mimetype mappings. |
mime_to_exts/1 | Return the set of known extensions of a mimetype. |
mime_to_exts/2 | Return the set of known extensions of a mimetype. |
mmodule/0 | |
path_to_mimes/1 | Return the set of known mimetypes based on the extension of a path. |
path_to_mimes/2 | Return the set of known mimetypes based on the extension of a path. |
start_link/0 | Starts the server. |
types/0 | Return a list of all available mimetypes. |
create(Database::term()) -> ok
Create a new database of extension-mimetype mappings. The name 'default' is reserved.
dmodule() -> any()
ext_to_mimes(Extension::string() | binary()) -> [binary()]
Equivalent to ext_to_mimes(Extension, default).
Return the set of known mimetypes of an extension.
ext_to_mimes(Extension::string() | binary(), Database::term()) -> [binary()]
Return the set of known mimetypes of an extension.
extension(Extension::binary() | string()) -> [binary()]
Transforms an extension to a list of mimetypes.
Returns application/octet-stream if there is no data about given extension.
Example:
1> mimetypes:extension("c"). [<<"text/x-c">>] 2> mimetypes:extension("hrl"). [<<"application/octet-stream">>] 3> mimetypes:extension(<<"html">>). [<<"text/html">>]
extensions() -> [binary()]
Return a list of all available extensions.
extensions(Types::[binary()] | binary()) -> [binary()]
Convert mimetype to a list of extensions.
Example:
1> mimetypes:extensions([<<"text/html">>]). [<<"htm">>,<<"html">>] 2> mimetypes:extensions([<<"text/html">>, <<"text/x-c">>]). [<<"c">>,<<"cc">>,<<"cpp">>,<<"cxx">>,<<"dic">>,<<"h">>, <<"hh">>,<<"htm">>,<<"html">>]
filename(Filename::string()) -> [binary()]
Convert a filename to a list of mimetypes.
Example:
1> mimetypes:filename("test.cpp"). [<<"text/x-c">>] 2> mimetypes:filename("/etc/fstab"). ["<<application/octet-stream">>] 3> mimetypes:filename("/etc/adduser.conf"). [<<"text/plain">>]
load(Database::term(), Mappings::[{binary(), binary()}]) -> ok
Load a set of extension-mimetype mappings.
load(Database::term(), Mappings::[{binary(), binary()}], Timeout::infinity | integer()) -> ok
Load a set of extension-mimetype mappings.
mime_to_exts(MimeType::string() | binary()) -> [binary()]
Equivalent to mime_to_exts(MimeType, default).
Return the set of known extensions of a mimetype.
mime_to_exts(MimeType::string() | binary(), Database::term()) -> [binary()]
Return the set of known extensions of a mimetype.
mmodule() -> any()
path_to_mimes(Path::string() | binary()) -> [binary()]
Return the set of known mimetypes based on the extension of a path.
path_to_mimes(Path::string() | binary(), Database::term()) -> [binary()]
Return the set of known mimetypes based on the extension of a path.
start_link() -> {ok, Pid} | ignore | {error, Error}
Starts the server
types() -> [binary()]
Return a list of all available mimetypes.
Generated by EDoc, Mar 17 2013, 14:47:56.