MimeType Resolver

This library resolves a mime-type of file by the binary content.

Лицензия

Лицензия

Категории

Категории

Ant Компиляция и сборка
Группа

Группа

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

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

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

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

0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

MimeType Resolver
This library resolves a mime-type of file by the binary content.
Ссылка на сайт

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

https://github.com/antkorwin/mimetype
Система контроля версий

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

http://github.com/antkorwin/mimetype

Скачать mimetype

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

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

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
com.antkorwin : throwable-functions jar 1.2
org.apache.tika : tika-core jar 1.24.1
org.apache.tika : tika-parsers jar 1.24.1
commons-codec : commons-codec jar 1.14

test (7)

Идентификатор библиотеки Тип Версия
com.antkorwin : ioutils jar 0.3
org.assertj : assertj-core jar 3.9.1
org.mockito : mockito-core jar 2.15.0
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3
org.junit.jupiter : junit-jupiter-api jar 5.6.2
org.junit.jupiter : junit-jupiter-engine jar 5.6.2

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

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

Get MimeType of the file in Java

Build Status

This is a collection of simple classes which retrieve meta-data from the file content.

1. Getting started

Just add the following dependency in your pom.xml file:

<dependency>
    <groupId>com.antkorwin</groupId>
    <artifactId>mimetype</artifactId>
    <version>0.1</version>
</dependency>

2. How to get mime-type of file in java

File file = new File("document.pdf");
String type = new MimeTypeResolver().get(file);
System.out.println(type);

this code prints : application/pdf

3. How to get SHA-256 of file content in Java

File file = new File("document.pdf");
String sha256 = new Sha256Resolver().get(file);
System.out.println(sha256);

this code prints the SHA-256 of the document.pdf file : bbf9546ec49f2bfe384a91cb5a33831c67a69fb8a7197346f261df0aa8f7a048

4. How to extract text of the Word\Excel\Pdf document in Java

File file = new ResourceFile("word.docx").getFile();
String text = new FileTextResolver().get(file);
assertThat(text).containsSubsequence("This is the content of word file...");

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

Версия
0.2
0.1