Jubako for Mere Mortals
Jubako is a ground technology using to create new file format to store content together.
You probably want to look at Arx for such file format.
Jubako for Techies
Jubako is two things:
- A specification for a meta-format, allowing to create new container format.
- A reference implementation in Rust allowing to create and parse Jubako container.
As a "Vendor", you, a developer, have to specify what do you want to store your Jubako container. Jubako will take care about how it is stored.
As XML, Jubako is a format describing how to store content and how it is structured. It doesn't specify what is stored and the hierarchy between those content.
Features
Generic
Jubako is a generic container. It doesn't enforce a specific content or specific meta-data. You decide what do you want to store and how.
For example:
- In Waj format, we have basic entries, stored in simple array with one content and mime-type metadata.
- In Arx format, entries contains more metadata (owner, group, mode...) and are linking to other entries (tree structure).
Optional Compression
Each content can be compressed or not. By default, Jubako implementation do not compress uncompressible content as image or video (based on file entropy).
But you can decide.
Directly Accessible
One main feature of Jubako format is that you don't have to extract the whole container to access the content inside.
Jubako is designed to allow quick location of the content and decompression of the relevant part only.
Compoundable
Jubako containers can contain different kind of entries. Arx archives contain directories, files and links. Waj contain content and redirect entries.
You can also decide to store an Arx and a Waj structures inside the same container, sharing the same content.
Extensible
A Jubako container is composed of different packs. By default, those packs are stored inside the same file, but you can decide to store them individually.
And you can decide to distribute all packs or not. For example, you can create a format to store images where you store low and high resolutions of the same image inside two different packs. Send a Jubako container with only the low res to your users. When (if) they get the high res pack later, Jubako will automatically provide the high res image.
Embedded
Jubako containers can be stored inside another content. This is even simpler if the container append at the end of a file as it can be open "by the end".
If you want to create an auto-extractible Arx archive,
just create a binary trying to open and extract itself, concat the binary to your Arx archive and your done.
In fact, such a binary exists already to create an auto-mount Arx archive on Linux.
Using Jubako
Jubako library is the low level library to read and write Jubako container. It is written in rust and it is expected you are creating a custom library on top of it, in rust too.
Once you have a custom library, you can wrap it in the language of your choice to use it in your project.
For now, there are two main application using Jubako: