-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.in
40 lines (27 loc) · 758 Bytes
/
README.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## mime2045
The `mime2045` package provides functions for parsing RFC 2045 MIME types.
## Features
* RFC 2045 MIME type parsing.
* Suggest file extensions for MIME types.
* High coverage test suite.
* [OSGi-ready](https://www.osgi.org/).
* [JPMS-ready](https://en.wikipedia.org/wiki/Java_Platform_Module_System).
* ISC license.
## Usage
Declare MIME types directly:
```
final var textPlain =
MimeType.of("text", "plain");
```
Parse MIME type strings:
```
final var parsed =
new MimeParsers().parse("text/plain");
assert textPlain.equals(parsed);
```
Suggest file extensions for MIME types:
```
final var parsed =
new MimeParsers().parse("text/plain");
assert Optional.of("txt").equals(MimeFileExtensions.suggestFileExtension(parsed));
```