openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis E. Hamilton" <dennis.hamil...@acm.org>
Subject RE: MIMEType of folder
Date Sun, 16 Jun 2013 15:19:17 GMT
If you are talking about content items within an ODF Package, whether a path is considered
that of a folder is determined in the ODF Package manifest.xml file.  The manifest.xml file
will specify the MIME TYPE of the collection of items having the same path in the beginning
of their file names when that collection has significance taken as a unit (more than just
sharing a common prefix on their names).  

*** If you are not asking about that case, you can stop here ***

TMI;DNR

Some implementations create manifest.xml file entries for folders for no particular purpose
(the MIME TYPE is not set).  These are unnecessary.  There is no requirement to have every
path segment reflected in the manifest.  Only those that prefix a collection of items where
the collection has a specific MIME type need to be distinguished.  The MIMETYPE indicates
what is special about items in that particular collection other than their names having a
common prefix of "/"-separated parts.

"Folders" have MIMETYPE entries, for example, when the items of another ODF document are embedded
in another ODF document instead of embedding the other document's package as a single item.
 The common prefix on the Zip file names of those embedded items will have an entry that provides
the ODF MIMETYPE for the embedded document.  Actual files embedded in the ODF package, including
another ODF package as a single file are required to have entries in manifest.xml that gives
their MIMETYPEs.  

You might need to experiment to see if the Apache OpenOffice SDK or source-code objects you
are using return a default MIMETYPE for manifest entries having no specified MIMETYPE and
whether it will do that even for paths used in the filenames and not identified in the manifest.
 I suspect that happens if the API you are using provides navigation of the package as if
it is a hierarchical collection of folders.  This is a synthesis.  The files in the Zip have
no hierarchical organization, although the contained files can have names of a hierarchical
form, often for conceptual convenience and as a way to keep names separated into useful non-conflicting
categories, such as "META-INF/...", "Configurations2/...", etc.  

Please note that this narrative is from the perspective of the ODF specifications, not incidentals
of implementations, even though those incidentals matter if you encounter them in the API
or object model of Apache OpenOffice.

 - Dennis

-----Original Message-----
From: Rajath Shashidhara [mailto:rajaths.rajaths@gmail.com] 
Sent: Sunday, June 16, 2013 02:38 AM
To: dev
Subject: Re: MIMEType of folder

Hello,
description of getContentType():
returns a type string, which is unique for that type of content (e.g.
"application/vnd.sun.star.hierarchy-folder").

is a folder's unique content type application/vnd.sun.star.hierarchy-folder?


On Sun, Jun 16, 2013 at 1:07 PM, Rajath Shashidhara <
rajaths.rajaths@gmail.com> wrote:

> Hello,
>
> When requested for MIMEType/ContentType for a folder, what should be the
> result?
>
>
> --
> Rajath S,
> M.Sc(Hons.) Physics,
> Birla Institute of Technology and Science - Pilani,
> Pilani
>



-- 
Rajath S,
M.Sc(Hons.) Physics,
Birla Institute of Technology and Science - Pilani,
Pilani


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Mime
View raw message