[
https://issues.apache.org/jira/browse/ARIES-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14035642#comment-14035642
]
Cristiano Gavião commented on ARIES-1212:
-----------------------------------------
I agree that subsystems should fall back to using the file extension name when
there is no mime type.
I don't think there is a API to get the mime-type of a entry, when that entry
is a uncompressed file. but you can get a file inside a compressed file that
tags it as mimetype compatible archive.
Thought, there is a API that lets you check the "magic code" of a file using
its input stream. For example, a zip file will always have "0x504b0304" value.
This way we can filter the contents of a subsystem archive and only process
those entries that are Compressed files (with or without the mimetype entry
file)...
> RawSubsystemResource should use the specified MIME type to filter contents
> instead its name
> -------------------------------------------------------------------------------------------
>
> Key: ARIES-1212
> URL: https://issues.apache.org/jira/browse/ARIES-1212
> Project: Aries
> Issue Type: Improvement
> Components: Subsystem
> Affects Versions: subsystem-1.0.1
> Reporter: Cristiano Gavião
>
> The Subsystem spec states that:
> bq. A Subsystem is deployed as a Subsystem Archive (.esa) file. Subsystem
> Archives are used to store Subsystems and optionally their resources in a
> standard ZIP-based file format.
> bq. This format is defined in Zip File Format. Subsystems normally use the
> Subsystem Archive extension of .esa but are not required to. However there is
> a special MIME type reserved for OSGi Subsystems that can be used to
> distinguish Subsystems from normal ZIP files. This MIME type is:
> application/vnd.osgi.subsystem
> bq. The type is defined in IANA application/vnd.osgi.subsystem.
> Current implementation don't care about MIME type and uses the content file's
> name to do the filtering before process contents. that should be avoided and
> potentially will prevent the bug stated in [ARIES-1148].
--
This message was sent by Atlassian JIRA
(v6.2#6252)