OSGi initial provisioning, talks about ZIP dictionary entries?
-
10-07-2019 - |
Question
The osgi R4 specification on 'initial provisioning page 231' talks about
'The result of the request must be a ZIP file(content type application/ZIP)'...'The zip file may contain only four types of dictionary entries: text, binary, bundle or bundle-url. The types are specified in the ZIP entry's extra field'
I don't know a ZIP file other than having files with a single name. Has anyone found an example which shows such a zip file ?
Many thanks!
Solution
As I understand it, the ZipEntry name is the "name" part of the name-value pair, the data is the "value" part, and - here's the whacky bit - the "extra" field of ZipEntry holds a MIME type which explains how the data is to be interpreted, e.g. as a byte array, as String data, or as a URL pointing to the "real" data. Quite ingenious really. We tend to think of a zip file as holding just file names and contents, but in fact each entry in a zip file holds or can hold quite a bit of metatdata; name, "extra" data, comment, CRC, compression method used, etc.. Java.util.zip.ZipEntry allows you to set all of these fields, so it's no problem to create such files in Java - even if none of us ever saw such a beast before.