mimetypes

Java (JVM) lookup table for standard mime types and their extensions

Лицензия

Лицензия

Группа

Группа

com.github.amr
Идентификатор

Идентификатор

mimetypes
Последняя версия

Последняя версия

0.0.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

mimetypes
Java (JVM) lookup table for standard mime types and their extensions
Ссылка на сайт

Ссылка на сайт

http://github.com/amr/mimetypes
Система контроля версий

Система контроля версий

https://github.com/amr/mimetypes.git

Скачать mimetypes

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.amr/mimetypes/ -->
<dependency>
    <groupId>com.github.amr</groupId>
    <artifactId>mimetypes</artifactId>
    <version>0.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.amr/mimetypes/
implementation 'com.github.amr:mimetypes:0.0.3'
// https://jarcasting.com/artifacts/com.github.amr/mimetypes/
implementation ("com.github.amr:mimetypes:0.0.3")
'com.github.amr:mimetypes:jar:0.0.3'
<dependency org="com.github.amr" name="mimetypes" rev="0.0.3">
  <artifact name="mimetypes" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.amr', module='mimetypes', version='0.0.3')
)
libraryDependencies += "com.github.amr" % "mimetypes" % "0.0.3"
[com.github.amr/mimetypes "0.0.3"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

MimeTypes

Build Status Test Coverage

Java (JVM) lookup table for standard mime types and their extensions.

API Usage

Get the extension for a mime type:

MimeTypes.getInstance().getByType("image/png").getExtension(); // returns "png"

Get all possible extensions for a mime type:

MimeTypes.getInstance().getByType("image/png").getExtensions(); // returns String[]{"png"}
MimeTypes.getInstance().getByType("text/html").getExtensions(); // returns String[]{"html", "htm"}

Get mime type for an extension:

MimeTypes.getInstance().getByExtension("png").getMimeType(); // returns "image/png"

Register a custom mimetype and query it up later:

MimeTypes.getInstance().register(new MimeType("application/vnd.awesome", new String[]{"wsm"}));
MimeTypes.getInstance().getByType("application/vnd.awesome").getExtension(); // returns "wsm"

Initialize with a custom "mime.types" definitions file:

new MimeTypes(Paths.get("/path/to/custom/mime.types"));

Alternatively:

MimeTypes.blank().load(Paths.get("/path/to/custom/mime.types"));

Build

Using maven:

mvn package

If you want the sources and javadocs too:

mvn package -P release

Maven central coordinates

New releases are submitted to central, to use:

<dependencies>
  <dependency>
    <groupId>com.github.amr</groupId>
    <artifactId>mimetypes</artifactId>
    <version>0.0.3</version>
  </dependency>
</dependencies>

Included mime types

MimeTypes.getInstance() or the empty constructor new MimeTypes() will load the included mime.types definitions, which is downloaded from:

http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types

JVM

JVM 7 or later is required.

License

Версии библиотеки

Версия
0.0.3
0.0.2