Watch
2
0
Fork
You've already forked mime2045
0
RFC 2045 MIME type parsing
  • Java 92.5%
  • Lex 7.4%
  • CSS 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mark Raynsford fa3e3ed3db
Some checks are pending
main-RHEL10-x86_64-jdk25 / Build (push) Waiting to run
main-RHEL10-x86_64-jdk26 / Build (push) Waiting to run
main-RHEL9-x86_64-jdk25 / Build (push) Waiting to run
main-RHEL9-x86_64-jdk26 / Build (push) Waiting to run
Update workflows.
2026-07-31 18:42:58 +01:00
.forgejo Update workflows. 2026-07-31 18:42:58 +01:00
com.io7m.mime2045.bom Begin next development iteration. 2025-05-07 17:52:22 +00:00
com.io7m.mime2045.core Begin next development iteration. 2025-05-07 17:52:22 +00:00
com.io7m.mime2045.fileext Begin next development iteration. 2025-05-07 17:52:22 +00:00
com.io7m.mime2045.parser Begin next development iteration. 2025-05-07 17:52:22 +00:00
com.io7m.mime2045.parser.api Begin next development iteration. 2025-05-07 17:52:22 +00:00
com.io7m.mime2045.tests Begin next development iteration. 2025-05-07 17:52:22 +00:00
src/site/resources Update site metadata. 2025-08-09 15:07:11 +00:00
.gitignore Update .gitignore. 2024-05-07 16:01:46 +00:00
.gitmodules Move to new organization. 2024-05-01 20:23:14 +00:00
checkstyle-filter.xml Initial version 2022-12-06 20:03:51 +00:00
checkstyle-suppressions-1.0.dtd Initial version 2022-12-06 20:03:51 +00:00
doc7m-books.json Add doc7m-books.json 2026-07-31 18:36:49 +01:00
pom.xml Migrate project. 2026-06-27 10:12:33 +01:00
README-CHANGES.xml Mark release 1.2.0 2025-05-07 17:52:12 +00:00
README-LICENSE.txt Update LICENSE 2023-08-13 21:16:13 +00:00
README.in Migrate project. 2026-06-27 10:12:33 +01:00
README.md Migrate project. 2026-06-27 10:12:33 +01:00

mime2045

Maven Central Maven Central (snapshot) Java Version

com.io7m.mime2045

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.
  • JPMS-ready.
  • 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));