{"id":16416108,"url":"https://github.com/phax/phive-binary","last_synced_at":"2026-05-14T22:02:23.027Z","repository":{"id":219952650,"uuid":"750308385","full_name":"phax/phive-binary","owner":"phax","description":"A validation library for binary formats inspired by phive","archived":false,"fork":false,"pushed_at":"2024-04-15T10:14:11.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-16T07:44:20.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-30T11:53:41.000Z","updated_at":"2024-08-12T17:11:26.721Z","dependencies_parsed_at":null,"dependency_job_id":"954f84d5-638e-48fc-a4d7-001cc3558e34","html_url":"https://github.com/phax/phive-binary","commit_stats":null,"previous_names":["phax/phive-binary"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fphive-binary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fphive-binary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fphive-binary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fphive-binary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phax","download_url":"https://codeload.github.com/phax/phive-binary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240466790,"owners_count":19805862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T07:08:26.465Z","updated_at":"2026-05-14T22:02:23.021Z","avatar_url":"https://github.com/phax.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phive-binary\n\n\u003c!-- ph-badge-start --\u003e\n[![Sonatype Central](https://maven-badges.sml.io/sonatype-central/com.helger.phive/phive-binary/badge.svg)](https://maven-badges.sml.io/sonatype-central/com.helger.phive/phive-binary/)\n[![javadoc](https://javadoc.io/badge2/com.helger.phive/phive-binary/javadoc.svg)](https://javadoc.io/doc/com.helger.phive/phive-binary)\n\u003c!-- ph-badge-end --\u003e\n\nA validation library for binary formats inspired by phive.\nThe goal of the library is to make sure, that certain binary file types can be checked for validity based on either file extension or MIME Type.\n\nThis project is part of my Peppol solution stack. See https://github.com/phax/peppol for other components and libraries in that area.\n\n# Basic usage\n\nEach file format is implemented as an instance of `IFileFormatDescriptor`.\nEach file format is registered into the singleton instance `FileFormatRegistry.getInstance ()`.\nBased on a file extension (e.g. `pdf`) or based on a MIME type (e.g. `application/pdf`) you need to get the `IFileFormatDescriptor` you need.\nAnd for each file format descriptor several content validators may be available.\nVia `getContentValidatorFavourSpeed ()` or `getContentValidatorFavourAccuracy ()` the matching `IPhiveContentValidator` can be retrieved.\nAnd finally the content validator does the actual matching.\n\nSo to summarize:\n1. Get `IFileFormatDescriptor` from `FileFormatRegistry.getInstance ()`\n1. Choose the `IPhiveContentValidator` from the file format descriptor (this object can be cached by the way) \n1. Let the content validator check if the provided value matches\n\n# Extensibility\n\nAll known file formats are loaded via [SPI](https://docs.oracle.com/javase/tutorial/ext/basics/spi.html).\nBy implementing the `com.helger.phive.binary.IFileFormatRegistrarSPI` in your application, custom file formats can be added.\n\n# Maven usage\n\nAdd the following to your pom.xml to use this artifact, replacing `x.y.z` with the real version number:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.helger.phive\u003c/groupId\u003e\n  \u003cartifactId\u003ephive-binary\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n# News and Noteworthy\n\nv0.3.1 - work in progress\n* Removed OSGI bundling\n\nv0.3.0 - 2025-11-16\n* Updated to ph-commons 12.1.0\n* Using JSpecify annotations\n\nv0.2.0 - 2025-08-24\n* Requires Java 17 as the minimum version\n* Updated to ph-commons 12.0.0\n\nv0.1.0 - 2024-01-31\n* Initial version\n* Supported formats are: CSV (no content validator), GIF, JPG, PDF, PNG, PSD, TIFF, XLS, XSLX and XML","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fphive-binary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphax%2Fphive-binary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fphive-binary/lists"}